aspy21 0.1.1b8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aspy21-0.1.1b8/.env.example +28 -0
- aspy21-0.1.1b8/.github/SETUP_GUIDE.md +123 -0
- aspy21-0.1.1b8/.github/workflows/release.yml +33 -0
- aspy21-0.1.1b8/.github/workflows/tests.yml +47 -0
- aspy21-0.1.1b8/.gitignore +47 -0
- aspy21-0.1.1b8/.pre-commit-config.yaml +31 -0
- aspy21-0.1.1b8/CHANGELOG.md +33 -0
- aspy21-0.1.1b8/CODE_OF_CONDUCT.md +15 -0
- aspy21-0.1.1b8/CONTRIBUTING.md +11 -0
- aspy21-0.1.1b8/LICENSE +21 -0
- aspy21-0.1.1b8/PKG-INFO +358 -0
- aspy21-0.1.1b8/README.md +311 -0
- aspy21-0.1.1b8/SECURITY.md +16 -0
- aspy21-0.1.1b8/docs/_static/logo.png +0 -0
- aspy21-0.1.1b8/examples/README.md +141 -0
- aspy21-0.1.1b8/examples/basic_usage.py +89 -0
- aspy21-0.1.1b8/examples/search_tags.py +107 -0
- aspy21-0.1.1b8/justfile +148 -0
- aspy21-0.1.1b8/pyproject.toml +108 -0
- aspy21-0.1.1b8/scripts/bump_version.py +97 -0
- aspy21-0.1.1b8/setup.cfg +4 -0
- aspy21-0.1.1b8/src/aspy21/__init__.py +17 -0
- aspy21-0.1.1b8/src/aspy21/_version.py +34 -0
- aspy21-0.1.1b8/src/aspy21/cache.py +34 -0
- aspy21-0.1.1b8/src/aspy21/client.py +684 -0
- aspy21-0.1.1b8/src/aspy21/models.py +19 -0
- aspy21-0.1.1b8/src/aspy21/utils.py +27 -0
- aspy21-0.1.1b8/src/aspy21.egg-info/PKG-INFO +358 -0
- aspy21-0.1.1b8/src/aspy21.egg-info/SOURCES.txt +35 -0
- aspy21-0.1.1b8/src/aspy21.egg-info/dependency_links.txt +1 -0
- aspy21-0.1.1b8/src/aspy21.egg-info/requires.txt +18 -0
- aspy21-0.1.1b8/src/aspy21.egg-info/top_level.txt +1 -0
- aspy21-0.1.1b8/tests/__init__.py +0 -0
- aspy21-0.1.1b8/tests/conftest.py +8 -0
- aspy21-0.1.1b8/tests/test_auth.py +18 -0
- aspy21-0.1.1b8/tests/test_client.py +626 -0
- aspy21-0.1.1b8/tests/test_logging.py +48 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Aspen IP.21 Configuration
|
|
2
|
+
# Copy this file to .env and fill in your actual values
|
|
3
|
+
|
|
4
|
+
# Server URL (full path to AtProcessDataREST.dll)
|
|
5
|
+
ASPEN_BASE_URL=http://YOUR_SERVER/ProcessData/AtProcessDataREST.dll
|
|
6
|
+
|
|
7
|
+
# Basic Authentication
|
|
8
|
+
ASPEN_USERNAME=yourusername
|
|
9
|
+
ASPEN_PASSWORD=yourpassword
|
|
10
|
+
|
|
11
|
+
# Datasource name (leave empty for server default)
|
|
12
|
+
ASPEN_DATASOURCE=datasource_name
|
|
13
|
+
|
|
14
|
+
# Optional settings
|
|
15
|
+
ASPEN_TIMEOUT=60.0
|
|
16
|
+
ASPEN_VERIFY_SSL=False
|
|
17
|
+
|
|
18
|
+
# Logging level (DEBUG, INFO, WARNING, ERROR, CRITICAL)
|
|
19
|
+
ASPEN_LOG_LEVEL=INFO
|
|
20
|
+
|
|
21
|
+
# PyPI Publishing (for maintainers only)
|
|
22
|
+
# Get tokens from:
|
|
23
|
+
# - TestPyPI: https://test.pypi.org/manage/account/token/
|
|
24
|
+
# - PyPI: https://pypi.org/manage/account/token/
|
|
25
|
+
PYPI_TEST_USERNAME=__token__
|
|
26
|
+
PYPI_TEST_TOKEN=your-testpypi-token-here
|
|
27
|
+
PYPI_USERNAME=__token__
|
|
28
|
+
PYPI_TOKEN=your-pypi-token-here
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Development Setup Guide
|
|
2
|
+
|
|
3
|
+
This guide will help you set up your development environment for the aspy21 project.
|
|
4
|
+
|
|
5
|
+
## Prerequisites
|
|
6
|
+
|
|
7
|
+
- Python 3.9+ installed
|
|
8
|
+
- [uv](https://github.com/astral-sh/uv) package manager
|
|
9
|
+
- [just](https://just.systems/) task runner (optional but recommended)
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
### 1. Install uv (if not already installed)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### 2. Install dependencies
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
uv pip install -e ".[dev]"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### 3. Setup pre-commit hooks
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pre-commit install
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Available Commands
|
|
32
|
+
|
|
33
|
+
If you have `just` installed, you can use these convenient commands:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
just install # Install dependencies
|
|
37
|
+
just setup-hooks # Setup pre-commit hooks
|
|
38
|
+
just test # Run tests with coverage
|
|
39
|
+
just lint # Run linter
|
|
40
|
+
just lint-fix # Auto-fix linting issues
|
|
41
|
+
just format # Format code
|
|
42
|
+
just typecheck # Run type checking
|
|
43
|
+
just check # Run all checks (lint, format, typecheck)
|
|
44
|
+
just ci # Run all checks + tests (same as CI)
|
|
45
|
+
just clean # Clean build artifacts
|
|
46
|
+
just build # Build distribution packages
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Or use the tools directly:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# Testing
|
|
53
|
+
pytest
|
|
54
|
+
pytest -vv # verbose
|
|
55
|
+
pytest tests/test_client.py # specific file
|
|
56
|
+
|
|
57
|
+
# Linting & Formatting
|
|
58
|
+
ruff check .
|
|
59
|
+
ruff check --fix .
|
|
60
|
+
ruff format .
|
|
61
|
+
|
|
62
|
+
# Type Checking
|
|
63
|
+
pyright
|
|
64
|
+
|
|
65
|
+
# Pre-commit (run all hooks)
|
|
66
|
+
pre-commit run --all-files
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## Project Structure
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
aspy21/
|
|
73
|
+
├── src/aspy21/ # Main package code
|
|
74
|
+
│ ├── __init__.py
|
|
75
|
+
│ ├── client.py # AspenClient implementation
|
|
76
|
+
│ ├── models.py # Data models (ReaderType, etc.)
|
|
77
|
+
│ ├── utils.py # Utility functions
|
|
78
|
+
│ └── cache.py # Caching implementation
|
|
79
|
+
├── tests/ # Test suite
|
|
80
|
+
├── .github/workflows/ # CI/CD pipelines
|
|
81
|
+
├── docs/ # Documentation
|
|
82
|
+
├── pyproject.toml # Project configuration
|
|
83
|
+
├── justfile # Task automation
|
|
84
|
+
└── .pre-commit-config.yaml # Pre-commit hooks
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Modern Toolchain (2025)
|
|
89
|
+
|
|
90
|
+
This project uses the latest Python tooling:
|
|
91
|
+
|
|
92
|
+
- **Package Manager**: `uv` (10-100x faster than pip)
|
|
93
|
+
- **Linter + Formatter**: `ruff` (replaces black, flake8, isort)
|
|
94
|
+
- **Type Checker**: `pyright` (fast, actively maintained)
|
|
95
|
+
- **Test Runner**: `pytest` with coverage
|
|
96
|
+
- **Task Runner**: `just` (optional, for convenience)
|
|
97
|
+
- **Pre-commit**: Automated code quality checks
|
|
98
|
+
|
|
99
|
+
## CI/CD
|
|
100
|
+
|
|
101
|
+
GitHub Actions automatically:
|
|
102
|
+
- Tests on Python 3.9, 3.10, 3.11, 3.12, 3.13
|
|
103
|
+
- Runs linting, formatting, and type checking
|
|
104
|
+
- Reports test coverage to Codecov
|
|
105
|
+
- Publishes to PyPI on version tags
|
|
106
|
+
|
|
107
|
+
## Publishing to PyPI
|
|
108
|
+
|
|
109
|
+
1. Update version in `pyproject.toml`
|
|
110
|
+
2. Update `CHANGELOG.md`
|
|
111
|
+
3. Create and push a git tag:
|
|
112
|
+
```bash
|
|
113
|
+
git tag v0.1.0
|
|
114
|
+
git push origin v0.1.0
|
|
115
|
+
```
|
|
116
|
+
4. GitHub Actions will automatically build and publish to PyPI
|
|
117
|
+
|
|
118
|
+
## Tips
|
|
119
|
+
|
|
120
|
+
- Always run `just check` before committing
|
|
121
|
+
- Pre-commit hooks will catch issues automatically
|
|
122
|
+
- Use `just ci` to run the same checks as GitHub Actions locally
|
|
123
|
+
- Keep CHANGELOG.md updated with each change
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Release to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags:
|
|
6
|
+
- "v*.*.*"
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build-publish:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write # for trusted publishing
|
|
13
|
+
contents: read
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Install uv
|
|
18
|
+
uses: astral-sh/setup-uv@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: "3.11"
|
|
24
|
+
|
|
25
|
+
- name: Build distribution
|
|
26
|
+
run: |
|
|
27
|
+
uv pip install --system build
|
|
28
|
+
python -m build
|
|
29
|
+
|
|
30
|
+
- name: Publish to PyPI
|
|
31
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
32
|
+
with:
|
|
33
|
+
skip-existing: true
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: Tests & Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main, develop ]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
14
|
+
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- name: Install uv
|
|
19
|
+
uses: astral-sh/setup-uv@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: |
|
|
28
|
+
uv pip install --system -e ".[dev]"
|
|
29
|
+
|
|
30
|
+
- name: Ruff lint
|
|
31
|
+
run: ruff check .
|
|
32
|
+
|
|
33
|
+
- name: Ruff format check
|
|
34
|
+
run: ruff format --check .
|
|
35
|
+
|
|
36
|
+
- name: Type check (pyright)
|
|
37
|
+
run: pyright
|
|
38
|
+
|
|
39
|
+
- name: Run tests
|
|
40
|
+
run: pytest --cov=aspy21 --cov-report=xml --cov-report=term
|
|
41
|
+
|
|
42
|
+
- name: Upload coverage to Codecov
|
|
43
|
+
uses: codecov/codecov-action@v4
|
|
44
|
+
if: matrix.python-version == '3.11'
|
|
45
|
+
with:
|
|
46
|
+
file: ./coverage.xml
|
|
47
|
+
fail_ci_if_error: false
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.pyc
|
|
4
|
+
*.pyo
|
|
5
|
+
*.pyd
|
|
6
|
+
*.egg-info/
|
|
7
|
+
.build/
|
|
8
|
+
dist/
|
|
9
|
+
build/
|
|
10
|
+
.coverage
|
|
11
|
+
htmlcov/
|
|
12
|
+
.pytest_cache/
|
|
13
|
+
.ruff_cache/
|
|
14
|
+
.mypy_cache/
|
|
15
|
+
.tox/
|
|
16
|
+
.Python
|
|
17
|
+
*.egg
|
|
18
|
+
*.whl
|
|
19
|
+
|
|
20
|
+
# Virtual environments
|
|
21
|
+
.venv/
|
|
22
|
+
venv/
|
|
23
|
+
env/
|
|
24
|
+
ENV/
|
|
25
|
+
|
|
26
|
+
# Environment files (may contain secrets)
|
|
27
|
+
.env
|
|
28
|
+
.env.*
|
|
29
|
+
!.env.example
|
|
30
|
+
|
|
31
|
+
# IDE
|
|
32
|
+
.vscode/
|
|
33
|
+
.idea/
|
|
34
|
+
|
|
35
|
+
# Jupyter Notebooks
|
|
36
|
+
.ipynb_checkpoints/
|
|
37
|
+
|
|
38
|
+
# OS
|
|
39
|
+
.DS_Store
|
|
40
|
+
Thumbs.db
|
|
41
|
+
|
|
42
|
+
# Development context (contains session-specific info)
|
|
43
|
+
CLAUDE.md
|
|
44
|
+
WORKFLOW.md
|
|
45
|
+
|
|
46
|
+
# Auto-generated version file
|
|
47
|
+
src/aspy21/_version.py
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
3
|
+
rev: v0.8.4
|
|
4
|
+
hooks:
|
|
5
|
+
- id: ruff
|
|
6
|
+
args: [--fix]
|
|
7
|
+
- id: ruff-format
|
|
8
|
+
|
|
9
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
10
|
+
rev: v5.0.0
|
|
11
|
+
hooks:
|
|
12
|
+
- id: trailing-whitespace
|
|
13
|
+
- id: end-of-file-fixer
|
|
14
|
+
- id: check-yaml
|
|
15
|
+
- id: check-added-large-files
|
|
16
|
+
- id: check-merge-conflict
|
|
17
|
+
- id: check-toml
|
|
18
|
+
|
|
19
|
+
- repo: https://github.com/RobertCraigie/pyright-python
|
|
20
|
+
rev: v1.1.389
|
|
21
|
+
hooks:
|
|
22
|
+
- id: pyright
|
|
23
|
+
additional_dependencies:
|
|
24
|
+
- httpx>=0.27
|
|
25
|
+
- pandas>=2.0
|
|
26
|
+
- pydantic>=2.6
|
|
27
|
+
- python-dateutil>=2.9
|
|
28
|
+
- tenacity>=9.0
|
|
29
|
+
- python-dotenv>=1.0
|
|
30
|
+
- pytest>=8.2
|
|
31
|
+
- respx>=0.21
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- Initial project structure
|
|
12
|
+
- AspenClient with REST API support
|
|
13
|
+
- Support for analog, discrete, and text tags
|
|
14
|
+
- Unified pandas DataFrame output
|
|
15
|
+
- Built-in caching with SQLite
|
|
16
|
+
- Automatic retry logic with tenacity
|
|
17
|
+
- Type annotations and type checking
|
|
18
|
+
- Comprehensive test suite
|
|
19
|
+
- GitHub Actions CI/CD pipeline
|
|
20
|
+
- MIT License
|
|
21
|
+
|
|
22
|
+
## [0.1.0] - 2025-10-29
|
|
23
|
+
|
|
24
|
+
### Added
|
|
25
|
+
- Initial release
|
|
26
|
+
- REST-only backend for Aspen InfoPlus.21
|
|
27
|
+
- Support for RAW, INT, SNAPSHOT, AVG reader types
|
|
28
|
+
- DataFrame output with optional status column
|
|
29
|
+
- Transparent batching and connection management
|
|
30
|
+
- 100% type-annotated code
|
|
31
|
+
|
|
32
|
+
[Unreleased]: https://github.com/bazdalaz/aspy21/compare/v0.1.0...HEAD
|
|
33
|
+
[0.1.0]: https://github.com/bazdalaz/aspy21/releases/tag/v0.1.0
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
We follow the [Contributor Covenant](https://www.contributor-covenant.org/) Code of Conduct.
|
|
4
|
+
|
|
5
|
+
## Our Pledge
|
|
6
|
+
Be respectful, inclusive, and constructive.
|
|
7
|
+
|
|
8
|
+
## Our Standards
|
|
9
|
+
- Use welcoming language
|
|
10
|
+
- Be considerate of differing viewpoints
|
|
11
|
+
- Gracefully accept constructive criticism
|
|
12
|
+
- Focus on what is best for the community
|
|
13
|
+
|
|
14
|
+
## Enforcement
|
|
15
|
+
Report issues to the maintainers at **bazdalaz@gmail.com**.
|
aspy21-0.1.1b8/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 bazdalaz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|