semvec/pypi-packages huggingface dataset:
importenv 1.0.0
The simplest possible syntax for loading environment variables from the .env file and system environment variables.
License: MIT
Requires Python: <4.0,>=3.8
Keywords: import env, .env, environment, environment variables

# importenv

This package provides a convenient way to load environment variables from the `.env` file and system environment variables, automatically parsing them into appropriate Python types (`bool`, `int`, `float`, or `str`). It also allows you to access the loaded variables as attributes.

**Features:**

- Parses `.env` file values into their correct types.
- Supports boolean, integer, float, and string conversions.
- Skips empty lines and comments.
- Raises an error for malformed `.env` lines or missing variables.
- Provides a `__dir__` method for inspecting available keys.

## Installation

```sh
pip install importenv
```

## Usage

```python
>>> import env

>>> env.KEY  # Access environment variables as attributes
'Value'

>>> env.DEBUG  # Boolean Variable
False

>>> env.SECRET_KEY  # String Variable
'fake-secret-key'

>>> env.POSTGRESQL_PORT  # Integer Variable
5432

>>> env.SLEEP_TIME  # Float Variable
1.5

>>> env.ALLOWED_HOSTS.split(",")  # Convert to a list
["localhost", "127.0.0.1", "example.com"]

>>> env.UNDEFINED_VARIABLE  # Undefined Variable
None

>>> env.MY_VARIABLE or "default_value"  # Get the variable with a default fallback
"default_value"

```

### Example: How do I use it with Django?

For a typical Django project, the `.env` file is placed like this:

```bash
my_project/
├── .env                 # Your environment variables
├── manage.py            # Django project entry point
├── my_project/          # Main application folder
│   ├── __init__.py
│   ├── settings.py      # Django settings file where .env is loaded
│   ├── urls.py
│   └── wsgi.py
└── apps/
    ├── app1/
    └── app2/
```

An example of Django settings

```python
import env
from unipath import Path

BASE_DIR = Path(__file__).parent


SECRET_KEY = env.SECRET_KEY
DEBUG = env.DEBUG or False
ALLOWED_HOSTS = env.ALLOWED_HOSTS.split(",")


DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql",
        "NAME": env.DJANGO_DB_NAME,
        "USER": env.DJANGO_DB_USERNAME,
        "PASSWORD": env.DJANGO_DB_PASSWORD,
        "PORT": env.DJANGO_DB_PORT or 5432,
        "HOST": env.DJANGO_DB_HOST or "localhost",
    }
}


EMAIL_HOST_PASSWORD = env.EMAIL_HOST_PASSWORD
EMAIL_HOST_USER = env.EMAIL_HOST_USER
EMAIL_PORT = env.EMAIL_PORT or 25
EMAIL_HOST = env.EMAIL_HOST or "localhost"
EMAIL_USE_TLS = env.EMAIL_USE_TLS or False

# ...
```

## Running Tests

To run the tests, make sure you have `pytest` installed. You can install it using `requirements.txt`:

```sh
pip install -r requirements.txt
```

Then run:

```sh
pytest
```

This command will discover and execute all test cases in the project.
For more advanced options, you can refer to the [pytest documentation](https://docs.pytest.org/en/stable/).
conservation 1.0.1
Evolutionary Conservation of Amino Acids and Codons
License: MIT
Requires Python: >=3.6
Keywords: bioinformatics

# Conservation

[![PyPI version](https://badge.fury.io/py/conservation.svg)](https://badge.fury.io/py/conservation)

**Conservation** is a Python package for evolutionary conservation analysis at the codon and amino acid level. It supports comparative analysis using Pfam domain sequences and CDS datasets across multiple species.

## 🔧 Features

- Codon substitution matrix computation
- Fisher's exact test for conservation significance
- Automated visualization of alignment and substitution matrices
- Supports BLOSUM62 alignment, multi-threading, and multiple species

## 📦 Installation

You can install the package from PyPI:

```bash
pip install conservation
```

Or from Bioconda:

```bash
conda install -c bioconda conservation
```

Or install from source:

```bash
git clone https://github.com/hanjunlee21/conservation.git
cd conservation
pip install .
```

## 🚀 Usage

```bash
conservation codon \
  --domain domain.fasta \
  --cds species1.fasta,species2.fasta \
  --output results_dir \
  --threads 4
```

### Command-line Arguments

- `--domain`, `-d`: Pfam or domain FASTA file
- `--cds`, `-c`: Comma-separated list of CDS FASTA files (one per species)
- `--output`, `-o`: Output directory
- `--threads`, `-t`: Number of parallel threads
- `--fdr`, `-q`: FDR cutoff (optional)
- `--conservedness`, `-s`: Identity ratio threshold (optional)
- `--dpi`, `-r`: DPI for PDF plots

## 📊 Outputs

- Codon substitution matrix `.tsv`
- Statistical analysis `.statistics.tsv`
- PDF visualizations of alignments and substitution matrices

## 🧬 Example

Example command for 3 species:
```bash
conservation codon \
  -d pfam_domain.fasta \
  -c human.fasta,mouse.fasta,yeast.fasta \
  -o conservation_output
```

## 📁 Project Structure

```
conservation/
├── conservation/
├── ├── lib/
│   ├── └── N34_modifications.tsv
│   ├── __init__.py
│   ├── commands.py
│   ├── conservation_codon.py
│   └── version.py
├── bin/
│   └── conservation
├── README.md
├── setup.py
├── pyproject.toml
└── ...
```

## 📜 License

MIT License

## 👤 Author

**Hanjun Lee**  
[hanjun_lee@hms.harvard.edu](mailto:hanjun_leehms.harvard.edu)

Project URL: [https://github.com/hanjunlee21/conservation](https://github.com/hanjunlee21/conservation)