From 25c27ad568abbfd04ec796a220b4637e65437b8e Mon Sep 17 00:00:00 2001 From: Alexandros Raikos Date: Thu, 8 Apr 2021 15:21:17 +0300 Subject: [PATCH] doc updates --- README.md | 24 ++++++++++++++++++++++-- tests/README.md | 2 +- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b4bbb36..c1d6878 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/tests/README.md b/tests/README.md index 10c8a6f..7f1db80 100644 --- a/tests/README.md +++ b/tests/README.md @@ -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.