Skip to content

Commit

Permalink
doc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandros Raikos committed Apr 8, 2021
1 parent 90e6864 commit 25c27ad
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
24 changes: 22 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,34 @@ A Python library which extracts library dependencies from source files written i

## Usage

It is meant to be imported and called via a simple function, which returns an array of dependencies given a single file or a directory.
It is meant to be imported and called via a single module, which returns a `Set` of dependencies given a single file or a directory.

```python
from dextractor import analyse

dependencies = analyse("path/to-a/repo")
# Use all default parameters.
dependencies = analyse("path/to/file/or/directory")

# Define a different maximum file size (in bytes).
dependencies = analyse("path/to/file/or/directory", max_file_size=2000000) # <- 2MB

# Ignore local and relative dependencies.
dependencies = analyse("path/to/file/or/directory", strict=True)

# Enable verbose output.
dependencies = analyse("path/to/file/or/directory", verbose=True)

```

## Unit testing

Please consult the README in the `tests` folder.

## Supported languages

All languages which are supported are still in alpha. Regular expressions which detect imports in source files must be polished and updated with the nuances of each programming language. Currently the supported languages are:

1. C/C++
1. Go
1. Python (_duh!_)
1. Java
2 changes: 1 addition & 1 deletion tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ This directory is populated at will when cloning the repository. It is recommend

To run unit tests using `unittest` on package modules:

1. Clone your favorite repository into the `data` folder.
1. Clone a repository into the `data` folder.
1. From this project's root, run: `python -m unittest tests/test-analyse.py`
1. The testing script will return all imports found in the source code of your chosen repository.

0 comments on commit 25c27ad

Please sign in to comment.