Catalog PyPI
Back to packageRELEASE DETAILS

0.1.1

PyPI

accessnode

A secure and flexible database management system

databasefastapimanagementmongodbmysqlpostgresql
Published19 Sept 2025
Direct dependencies22
Transitive dependenciesNot calculated

README

Version 0.1.1 documentation

AccessNode Database Manager

A secure and flexible database management system that provides both SDK and API access to multiple database types.

AccessNode serves as a unified interface for database operations across PostgreSQL, MySQL, MongoDB, and SQLite, offering both direct Python integration and REST API access.

🚀 Features

Core Capabilities

  • 🗄️ Multi-database support: PostgreSQL, MySQL, MongoDB, SQLite
  • 🔐 Secure authentication: JWT tokens with encrypted credential storage
  • ⚡ Async operations: Full async/await support for high performance
  • 🎯 Dual access modes: Use as Python SDK or REST API service
  • 🔄 Schema management: Dynamic schema creation, validation, and migration
  • 💾 Smart caching: Memory and Redis caching strategies
  • 🔌 Plugin architecture: Extensible for new database types

Security Features

  • Encrypted database credentials at rest
  • bcrypt password hashing
  • JWT authentication
  • CORS protection
  • Safe query execution

📦 Installation

For SDK Usage

pip install accessnode-db-manager

For Development

# Clone and install with dev dependencies
git clone <repository-url>
cd AccessNode
pip install -e ".[dev]"

🔧 Quick Start

SDK Usage (Direct Python Integration)

from accessnode import AccessNode

# Initialize database connection
db = AccessNode(
    db_type="postgres",
    database_name="your_db",
    host="localhost",
    port=5432,
    username="user",
    password="pass"
)

# Initialize the connection
await db.initialize()

# Execute raw queries
results = await db.raw_query("SELECT * FROM your_table")

# Use built-in operations
user_data = await db.get("users", {"id": 1})
new_id = await db.insert("users", {"name": "John", "email": "john@example.com"})

API Service Usage

  1. Start the server:
uvicorn main:app --reload
  1. Register and authenticate:
# Register a user
curl -X POST "http://localhost:8000/user/register" \
  -H "Content-Type: application/json" \
  -d '{"username": "testuser", "password": "testpass"}'

# Get access token
curl -X POST "http://localhost:8000/user/token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "username=testuser&password=testpass"
  1. Set up database connection:
curl -X POST "http://localhost:8000/user/databases/setup" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my_postgres_db",
    "db_type": "postgres",
    "host": "localhost",
    "port": 5432,
    "database_name": "mydb",
    "username": "user",
    "password": "pass"
  }'

📚 Advanced Usage

Schema Management

# Enable schema enforcement
db = AccessNode(
    db_type="postgres",
    database_name="mydb",
    enforce_schemas=True,
    auto_sync=True
)

# Schema will be automatically managed
await db.initialize()

Caching

from accessnode.caching.redis_cache import RedisCache

# Initialize with Redis caching
cache = RedisCache(host="localhost", port=6379)
db = AccessNode(
    db_type="postgres",
    database_name="mydb",
    cache=cache
)

Multiple Database Types

# PostgreSQL
pg_db = AccessNode(db_type="postgres", database_name="pg_db", ...)

# MongoDB
mongo_db = AccessNode(db_type="mongodb", database_name="mongo_db", ...)

# MySQL
mysql_db = AccessNode(db_type="mysql", database_name="mysql_db", ...)

🔌 API Endpoints

Authentication

  • POST /user/register - Register a new user
  • POST /user/token - Login and get access token

Database Management

  • POST /user/databases/setup - Configure a new database connection
  • GET /user/databases - List user's database connections
  • DELETE /user/databases/{db_id} - Remove a database connection

Query Operations

  • POST /user/database/{db_id}/query - Execute database queries
  • GET /user/database/{db_id}/tables - List tables in database

Visit /docs after starting the server for interactive API documentation.

🛠️ Development

Setup

# Install dependencies
pip install -e ".[dev]"

# Set up environment variables
export POSTGRES_USER=your_user
export POSTGRES_PASSWORD=your_password
export POSTGRES_HOST=localhost
export POSTGRES_DB=accessnode_main

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=accessnode

# Run specific test file
pytest tests/test_accessnode.py -v

Code Quality

# Format code
black .

# Sort imports
isort .

# Lint code
ruff check .

# Type checking
mypy accessnode/

🏗️ Architecture

AccessNode follows a modular architecture:

  • Core Layer: Main AccessNode class and base interfaces
  • Database Layer: Database-specific handlers and connection pooling
  • Schema Layer: Dynamic schema management and validation
  • Query Layer: Cross-database query building and compilation
  • Caching Layer: Multiple caching strategies and cache-aware operations
  • API Layer: FastAPI routes and authentication
  • Security Layer: Encryption, hashing, and secure credential management

🔒 Security

  • Encrypted storage: Database credentials encrypted at rest using AES
  • Password security: bcrypt hashing for user passwords
  • Token-based auth: JWT tokens for API authentication
  • Input validation: Comprehensive input validation and sanitization
  • Connection security: Secure database connection handling

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🆘 Support

  • Documentation: Visit /docs endpoint when running the API
  • Issues: Report bugs and request features via GitHub Issues
  • Community: Join our discussions for questions and collaboration

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 22

Native requirements
22 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
aiomysql
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
aiomysql>=0.2.0runtime
asyncpg
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
asyncpg>=0.29.0runtime
cryptography
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
cryptography>=41.0.5runtime
databases
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
databases>=0.8.0runtime
fastapi
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
fastapi>=0.104.1runtime
passlib
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
passlib>=1.7.4runtime
pydantic
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pydantic>=2.5.1runtime
pymongo
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pymongo>=4.6.0runtime
pymysql
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pymysql>=1.1.0runtime
python-jose
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
python-jose>=3.3.0runtime
python-multipart
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
python-multipart>=0.0.6runtime
sqlalchemy
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
sqlalchemy>=2.0.23runtime
uvicorn
Environment
{
  "extras": "",
  "marker": null,
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
uvicorn>=0.24.0runtime
build
Environment
{
  "extras": "",
  "marker": "extra == \"build\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
build>=0.10.0; extra == "build"runtime
twine
Environment
{
  "extras": "",
  "marker": "extra == \"build\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
twine>=4.0.2; extra == "build"runtime
black
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
black>=23.11.0; extra == "dev"runtime
httpx
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
httpx>=0.25.1; extra == "dev"runtime
isort
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
isort>=5.12.0; extra == "dev"runtime
mypy
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
mypy>=1.7.0; extra == "dev"runtime
pytest-asyncio
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pytest-asyncio>=0.21.1; extra == "dev"runtime
pytest
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
pytest>=7.4.3; extra == "dev"runtime
ruff
Environment
{
  "extras": "",
  "marker": "extra == \"dev\"",
  "requires_python": ">=3.8",
  "evaluation": "NOT_EVALUATED"
}
ruff>=0.1.5; extra == "dev"runtime

Distribution files

2 collected
accessnode-0.1.1-py3-none-any.whl

bdist_wheel · 86.73 KB · Python py3

Source file
accessnode-0.1.1.tar.gz

sdist · 114.03 KB · Python source

Source file

Repository

PENDING
accessnode/accessnode

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 17:58 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:794e86f39bd08acdb37af7a94b4b2331d04fcdfcf0b10d90a667f8e258f3fe01

Other collected versions

View all collected versions →