semvec/pypi-packages huggingface dataset:
chemdataextractor2 2.4.0
A toolkit for extracting chemical information from the scientific literature.
License: MIT
Keywords: text-mining mining chemistry cheminformatics nlp html xml science scientific

ChemDataExtractor
==================================

ChemDataExtractor v2 is a toolkit for extracting chemical information from the scientific literature. Python 3.9 to Python 3.11 supported.


Installation
------------

#### Create a virtual environment, for example with `conda`

`conda create -n cde2 python=3.11`

#### Activate the `cde2` environment

`conda activate cde2`

#### Install `chemdataextractor2` with `pip`

`pip install chemdataextractor2`


Features
--------

- HTML, XML and PDF document readers
- Chemistry-aware natural language processing pipeline
- Chemical named entity recognition
- Rule-based parsing grammars for property and spectra extraction
- Table parser for extracting tabulated data
- Document processing to resolve data interdependencies

Documentation & Development
-----------------------------

Please read the documentation for instructions on contributing to the project.

https://cambridgemolecularengineering-chemdataextractor-development.readthedocs-hosted.com/en/latest/

License
-------

ChemDataExtractor v2 is licensed under the `MIT license`_, a permissive, business-friendly license for open source
software.

MIT license: https://github.com/CambridgeMolecularEngineering/ChemDataExtractor/blob/master/LICENSE
pyenv-load 0.1.1
Loads from text or JSON file into environment
License: MIT
Requires Python: >=3.9
Keywords: environment, variables, env, dotenv, json, configuration

# pyenv-load

A simple Python package to load environment variables from `.env` files or JSON files.

## Installation

You can install the package from PyPI:

```bash
pip install pyenv-load
```

Or using Poetry:

```bash
poetry add pyenv-load
```

## Usage

### Loading from a .env file

Create a `.env.local` file in your project directory:

```
DEBUG=True
API_KEY=my-secret-key
DB_HOST=localhost
DB_PORT=5432
```

Then, in your Python code:

```python
from pyenv_load import load_env

# Load from default .env.local in the current script's directory
load_env()

# Or specify a custom file and path
load_env(filename=".env.production", path="/path/to/config")

# Access the environment variables
import os
debug = os.environ.get("DEBUG")
api_key = os.environ.get("API_KEY")
```

### Loading from a JSON file

Create a `.env.json` file in your project directory:

```json
{
  "DEBUG": true,
  "API_KEY": "my-secret-key",
  "DB_HOST": "localhost",
  "DB_PORT": 5432
}
```

Then, in your Python code:

```python
from pyenv_load import load_env

# Load from a JSON file
load_env(filename=".env.json")

# Access the environment variables
import os
debug = os.environ.get("DEBUG")
api_key = os.environ.get("API_KEY")
```

## Features

- Load environment variables from `.env` files or JSON files
- Supports comments in `.env` files (first character [`#`] on a line)
- Validates environment variable names
- Handles quoted values in `.env` files
- Converts all values to strings when setting environment variables
- Properly formats complex JSON types (lists and dictionaries) using JSON serialization
- Automatic detection of file type based on file extension

### JSON Value Handling

When loading from JSON files:
- Simple values (strings, numbers, booleans, null) are converted using `str()`
- Complex values (arrays, objects) are converted using `json.dumps()`

For example, this JSON:
```json
{
  "STRING_KEY": "value",
  "NUMBER_KEY": 42,
  "ARRAY_KEY": [1, 2, 3],
  "OBJECT_KEY": {"nested": "value"}
}
```

Will produce these environment variables:
```
STRING_KEY=value
NUMBER_KEY=42
ARRAY_KEY=[1, 2, 3]
OBJECT_KEY={"nested": "value"}
```

## Environment Variable Rules

- Names must start with a letter or underscore
- Names can only contain letters, numbers, and underscores
- All values are converted to strings in the environment

## Error Handling

The `load_env` function returns:
- `True` if the file was loaded successfully
- `False` if an error occurred (with an error message printed to console)

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.