Welcome to Atarashi’s documentation!¶
Atarashi¶
This is a Google Summer of Code Project.
New License Scanner Project Which Should be Integrated with FOSSology
but also Work Independently.
Build (optional)¶
$ python setup.py build- Build will generate 3 new files in your current directory
data/Ngram_keywords.jsonlicenses/<SPDX-version>.csvlicenses/processedList.csv
- These files will be placed to their appropriate places by the install script. ### Install
# python setup.py install- In install folder, make the “atarashi-install.sh” executable
- Run <./atarashi-install.sh>
- pip install -r <pathto/requirements.txt>
How to run¶
Get the help by running atarashi -h or atarashi --help
Example¶
Running DLD agent
atarashi -a DLD /path/to/file.cRunning wordFrequencySimilarity agent
atarashi -a wordFrequencySimilarity /path/to/file.cRunning tfidf agent
With Cosine similarity
atarashi -a tfidf /path/to/file.catarashi -a tfidf -s CosineSim /path/to/file.cWith Score similarity
atarashi -a tfidf -s ScoreSim /path/to/file.c
Running Ngram agent
With Cosine similarity
atarashi -a Ngram /path/to/file.catarashi -a Ngram -s CosineSim /path/to/file.cWith Dice similarity
atarashi -a Ngram -s DiceSim /path/to/file.cWith Bigram Cosine similarity
atarashi -a Ngram -s BigramCosineSim /path/to/file.c
Running in verbose mode
atarashi -a DLD -v /path/to/file.cRunning with custom CSVs and JSONs
- Please reffer to the build instructions to get the CSV and JSON understandable by atarashi.
atarashi -a DLD -l /path/to/processedList.csv /path/to/file.catarashi -a Ngram -l /path/to/processedList.csv -j /path/to/ngram.json /path/to/file.c
Test¶
- Run imtihaan (meaning Exam in Hindi) with the name of the Agent.
- eg.
python atarashi/imtihaan.py /path/to/processedList.csv <DLD|tfidf|Ngram> <testfile> - See
python atarashi/imtihaan.py --helpfor more
Creating Debian packages¶
Install dependencies .. code-block:: guess
# apt-get install python3-setuptools python3-all debhelper # pip install stdeb
Create Debian packages .. code-block:: guess
$ python3 setup.py –command-packages=stdeb.command bdist_deb
Locate the files under
deb_dist
How to generate the documentation manually using sphinx¶
- Go to project directory ‘atarashi’.
#. Install Sphinx and m2r pip install sphinx m2r (Since this project is based on python so pip is already installed).
#.
Initialise
docs/directory withsphinx-quickstart```bash mkdir docs cd docs/ sphinx-quickstart ```
Root path for the documentation [.]: .Separate source and build directories (y/n) [n]: nautodoc: automatically insert docstrings from modules (y/n) [n]: yintersphinx: link between Sphinx documentation of different projects (y/n) [n]: y- Else use the default option
Setup the
conf.pyand includeREADME.mdEnable the following lines and change the insert path:
import os import sys sys.path.insert(0, os.path.abspath('../'))
Enable
m2rto insert.mdfiles in Sphinx documentation:[...] extensions = [ ... 'm2r', ] [...] source_suffix = ['.rst', '.md']
Include
README.mdby editingindex.rst.. toctree:: [...] readme .. mdinclude:: ../README.md
Auto-generate the
.rstfiles indocs/sourcewhich will be used to generate documentationcd docs/ sphinx-apidoc -o source/ ../atarashicd docsmake html
This will generate file in docs/_build/html. Go to: index.html
How to generate the documentation using setuptools¶
Build atarashi (or install sphinx using
pip install sphinx m2r)python3 setup.py build
Refresh source
.rstfilessphinx-apidoc -Pe -o source/ ../atarashi
#. Check for new modules files (if any) and add :private-members: under your new .. automodule::.
#.
Generate the docs
python3 setup.py build_sphinx
- Check
python3 setup.py build_sphinx --helpfor more.
You will get the files under build/sphinx/html.
You can change the theme of the documentation by changing html_theme in docs/config.py file.
You can choose from {‘alabaster’, ‘classic’, ‘sphinxdoc’, ‘scrolls’, ‘agogo’, ‘traditional’, ‘nature’, ‘haiku’, ‘pyramid’, ‘bizstyle’}