semvec/pypi-packages huggingface dataset:
focusnfe 0.1.1
A robust, type-safe Python library for interacting with FocusNFe services.
License: MIT
Requires Python: >=3.11

# FocusNFe Python Library

A robust, type-safe Python library for interacting with [FocusNFe](https://focusnfe.com.br/) services.

## Features

- **Pydantic Models**: All requests and responses are validated using Pydantic.
- **Requests Session**: Uses `requests.Session` for efficient connection pooling.
- **High Test Coverage**: 100% test coverage with `pytest` and `requests-mock`.
- **Sandbox/Production Support**: Easily switch between environments.

## Installation

This project uses `uv` for package management.

```bash
uv add focusnfe
```

## Quick Start

```python
from focusnfe import FocusNFe

# Sandbox (default)
client = FocusNFe(api_token="your_sandbox_token")

# Production
client = FocusNFe(api_token="your_production_token", sandbox=False)
```

## Services Documentation

For detailed examples and model information for each service, see:

- [NF-e (Product Invoices)](docs/nfe.md)
- [NFS-e (Service Invoices)](docs/nfse.md)

## Development

### Running Tests

```bash
uv run pytest --cov=src/focusnfe tests/
```

### Releasing New Versions

For information on how to release new versions of this library, see the [Release Guide](docs/RELEASE.md).

### Project Structure

- `src/focusnfe/client.py`: Main client class.
- `src/focusnfe/base.py`: Base API request handler.
- `src/focusnfe/models/`: Pydantic models for data validation.
- `tests/`: Comprehensive test suite.
- `docs/`: Detailed service documentation.
xml-normalizer 0.1.0
A config-driven XML flattening and multi-record extraction engine.
License: MIT
Requires Python: >=3.9
Keywords: xml, etl, flatten, normalizer, csv, json, cli

# xml-normalizer

A config-driven XML flattening and multi-record extraction engine.

## Features

- Auto-detects repeated record types
- Flattens nested XML into CSV/JSON
- Case-insensitive XPath extraction
- Namespace stripping
- Config-driven CLI
- Archive mode for processed XML

## Installation

```bash
pip install xml-normalizer
context-dep 0.1.1
Python dependency injection with minimal API using context managers
License: MIT
Requires Python: >=3.8

# context-dep

Python dependency injection with minimal API using context managers. Works as DI for any Python code, including frameworks like FastAPI. Use it for configs, clients, db sessions, contexts, loggers, etc.

Instead of passing the same stuff (database, config, API clients, current user) into every function, your code can grab it when needed — it’s reused for the duration of the work, cleaned up afterward, and easy to replace with fakes in tests from one place.

```bash
pip install context-dep
```

## Basic usage

```python
from context_dep import dep, context


@dep(cached=True)
def get_db():
    db = Database()
    yield db
    db.close()

def my_func():
    with get_db() as db:
        ...
```

## Overrides

```
@dep()
def get_mock_db():
    yield MockDatabase()

def main():
    with context({get_db: get_mock_db}):
        my_func()

```

## Recipe: argument-scoped caching

```python
from context_dep import dep

@dep(cached=True)
def get_session_db(env: str):
    ...

with get_session_db(env='test') as db:
    # separate cache for each environment
    ...
```

## Recipe: stub dependency for later injection

```python
@dep()
async def get_db():
    raise NotImplementedError

async with get_db() as db:
    ...

```

## Cache Lifetime

When `cached=True`, the dependency is reused within nested calls and cleaned up once:

```python
@dep(cached=True)
def get_db():
    db = Database()
    yield db
    db.close()

with get_db() as db:
    with get_db() as db2:  # Reuses the same instance
        assert db is db2
# Cleanup runs once when the outermost context exits
```

## Notes

- Works with both sync and async functions
- Context is managed with `contextvars` - safe for async/await

## API Reference

```python
def dep(
    cached: bool = False,
    cache_key_func = lambda *args, **kwargs: json.dumps(
        {"args": args, "kwargs": kwargs},
        sort_keys=True,
        default=str
    ),
):
    """
    Decorator for defining dependencies.

    Args:
        cached: If True, the dependency is reused within nested calls
        cache_key_func: Function to generate cache keys from arguments.
                        Defaults to JSON serialization with sorted keys (sort_keys=True, default=str)
    """
    ...

class context:
    """Context manager to scope dependencies"""
    def __init__(self, overrides: dict[Callable, Callable]): ...

class Container:
    """
    Dependency injection container, stores the cache and overrides

    By default, `dep` and `context` use a shared global container. 
    Create separate containers for isolation (e.g., testing, multi-tenancy)
    """
    def dep(self, cached: bool = False, cache_key_func = ...): ...
    def context(self, overrides: dict[Callable, Callable]): ...
```

## License

MIT License

## Author

Mark Lidenberg [marklidenberg@gmail.com](mailto:marklidenberg@gmail.com)
ravest 0.3.0
Radial Velocity fitting, simulation and model comparison
License: MIT
Requires Python: <3.14,>=3.11

# ravest

**Ravest is under active development, with lots of new features soon to be released for public use. This website will continue to be populated with new code and examples as they get released, so please check back soon for further updates! If you have any questions or ideas, please don't hesitate to contact me via email.**

---

**Radial Velocity fitting, simulation and mass precision estimation**
Features:
- Model exoplanets and host stars, to simulate RV data for given orbital and instrumental parameters
- Fit RV data with MCMC to explore posterior distributions for parameters - including Gaussian Processes for stellar activity
- Visualise/animate the star's orbit (coming soon!)
- Bayesian Model Comparison using [harmonic](https://astro-informatics.github.io/harmonic/) (**coming soon!**)


## Installation

### CPU-only
```bash
$ pip install ravest
```

### GPU/TPU support
Ravest requires JAX, so you may want to consult [the Jax installation docs](https://docs.jax.dev/en/latest/installation.html) if you want GPU or TPU support (tl;dr: install JAX first according to those instructions, then install Ravest on top).

## Usage

For an introduction to modelling planetary and stellar data, see the  [example modelling notebook](https://ravest.readthedocs.io/en/latest/Examples/example_model.html) for `ravest.model`.

For an example of how to fit a model to RV data, see the [example fitting notebook](https://ravest.readthedocs.io/en/latest/Examples/example_fitting.html) where we fit some ELODIE data for 51 Peg b.

For an example of how to use a Gaussian Process to mitigate stellar variability, see the [example GP notebook](https://ravest.readthedocs.io/en/latest/Examples/example_gp.html) where we use a quasiperiodic kernel on HARPS data for K2-229.

## Contributing

Interested in contributing? Check out the contributing guidelines. Please note that this project is released with a Code of Conduct. By contributing to this project, you agree to abide by its terms.

## Acknowledgements

Ravest makes use of the following open-source packages:
- [NumPy](https://numpy.org/) for numerical computing
- [SciPy](https://scipy.org/) for scientific computing algorithms
- [Matplotlib](https://matplotlib.org/) for plotting and visualisation
- [Astropy](http://www.astropy.org/) for astronomical calculations and utilities
- [pandas](https://pandas.pydata.org/) for data manipulation
- [tqdm](https://tqdm.github.io/) for progress bars
- [emcee](https://emcee.readthedocs.io/) for MCMC sampling
- [corner](https://corner.readthedocs.io/) for visualising posterior distributions
- [tinygp](https://tinygp.readthedocs.io/) for Gaussian Process modelling, which requires [JAX](https://jax.readthedocs.io/)
- [harmonic](https://astro-informatics.github.io/harmonic/) for Bayesian evidence estimation

## License

`ravest` was created by Ross Dobson. It is licensed under the terms of the MIT license.