Skip to content
Snippets Groups Projects
Commit 1b274227 authored by Françoise Conil's avatar Françoise Conil
Browse files

Explain installation, usage and made some remarks

parent 79cdf3d9
No related branches found
No related tags found
No related merge requests found
...@@ -13,6 +13,67 @@ Packaging informations : ...@@ -13,6 +13,67 @@ Packaging informations :
- https://packaging.python.org/en/latest/tutorials/packaging-projects/ - https://packaging.python.org/en/latest/tutorials/packaging-projects/
- https://choosealicense.com/ - https://choosealicense.com/
## Remark
The data files do not need to be packaged, just place them where the data
folder is installed.
## Build and install the package
```shell
$ flit build
$ pip install dist/import_resources_example-0.0.1-py3-none-any.whl
```
WARNING : The package is installed in the virtual environment, so the data
files must be placed there which is not a very pleasant location.
```shell
$ tree .venv/lib/python3.10/site-packages/import_resources_example
├── data
│ └── __init__.py
├── get_oms_data.py
├── get_population_info.py
└── __init__.py
```
When installing the package in development mode with `pip install -e .`, the
data folder is in the clone repository.
## Usage
Install the package and try to execute the functions.
```ipython
In [1]: from import_resources_example import get_population_info
In [2]: get_population_info.extract_population_general_info()
{'AUKUS': {'Time': '1950', 'PopTotal': '206513.782', 'PopDensity': '12.096'},
'African Group': {'Time': '1950',
'PopTotal': '227261.208',
'PopDensity': '7.761'},
'African Union': {'Time': '1950',
'PopTotal': '227274.19',
'PopDensity': '7.692'},
In [3]: from import_resources_example import get_oms_data
In [4]: get_oms_data.get_oms_data()
Out[4]:
[{'TrialID': 'NCT00173563',
'Public-title': 'Induction of Cytokines in Human Monocytes by SARS-CoV in Adults and Children',
'Date-registration': '12/09/2005',
'Source-Register': 'ClinicalTrials.gov',
'Recruitment-Status': 'Recruiting',
'Study type': 'Observational'},
{'TrialID': 'NCT00523276',
'Public-title': 'SARS Survivor Evaluations',
'Date-registration': '30/08/2007',
'Source-Register': 'ClinicalTrials.gov',
'Recruitment-Status': 'Not recruiting',
'Study type': 'Observational'},
```
## Troubleshooting ## Troubleshooting
If we have untracked data files in the package tree, flist refuses to build the If we have untracked data files in the package tree, flist refuses to build the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment