All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
-
Connection Type Access Changed
- Before:
connection_kind.config_class()(method call) - After:
connection_kind.config_class(property access)
Migration:
# Before config_class = ConnectionKind.ARANGO.config_class() # After config_class = ConnectionKind.ARANGO.config_class
- Before:
-
Connection Configuration Creation
- Before: Direct class instantiation with
hostsparameter - After: Use
urlparameter or factory with more flexible options
Migration:
# Before config = ArangoConnectionConfig(hosts="http://localhost:8529", cred_name="root", cred_pass="password") # After config = ArangoConnectionConfig(url="http://localhost:8529", username="root", password="password") # Or using factory config = ConfigFactory.create_config({ "db_type": "arango", "url": "http://localhost:8529", "username": "root", "password": "password" })
- Before: Direct class instantiation with
-
Renamed Credential Parameters
- Before:
cred_name,cred_pass - After:
username,password(with backward compatibility)
Migration:
# Before config = Neo4jConnectionConfig(cred_name="neo4j", cred_pass="password") # After (preferred) config = Neo4jConnectionConfig(username="neo4j", password="password") # Old params still work but are deprecated config = Neo4jConnectionConfig(cred_name="neo4j", cred_pass="password") # Still works
-
Before:
ip_addr -
After:
hostname -
Before: WSGIConfig.host
-
After: WSGIConfig.listen_addr
Migration:
# Before config = Neo4jConnectionConfig(cred_name="neo4j", cred_pass="password") # After (preferred) config = Neo4jConnectionConfig(username="neo4j", password="password") # Old params still work but are deprecated config = Neo4jConnectionConfig(cred_name="neo4j", cred_pass="password") # Still works
- Before:
-
URL Parsing Changes
- Before: Custom parsing with string operations
- After: Standard library
urlparsefor robust URL handling
Migration:
# Before - URL components were extracted with custom string operations # After - Just use the url parameter and components are automatically extracted config = WSGIConfig(url="http://localhost:5000/api/v1") print(config.protocol) # "http" print(config.ip_addr) # "localhost" print(config.port) # "5000" print(config.path) # "/api/v1"
-
Changed
hostsParameter tourl- Before: Primary URL parameter was named
hosts - After: Primary URL parameter is named
url
Migration:
# Before config = ProtoConnectionConfig(hosts="http://localhost:8080") # After config = ProtoConnectionConfig(url="http://localhost:8080")
- Before: Primary URL parameter was named
-
Direct URL-based Configuration
# Create config with just a URL config = ConfigFactory.create_config(url="neo4j://neo4j:password@localhost:7687/mydb")
-
Improved Factory with Type Inference
# Factory now tries to infer connection type from URL config = ConfigFactory.create_config(url="http://localhost:8529/_db/mydb") # Will infer ArangoDB if "arango" is in URL
-
Expanded File Handling
# Load configuration from JSON or YAML config = ConfigFactory.create_config(path="config.json") config = ConfigFactory.create_config(path="config.yaml") # Save configuration from suthing import FileHandle FileHandle.save(config.__dict__, "config.json")
-
First-Class Support for Connection Base Class
# Use the factory with automatic type detection from suthing import ConnectionConfig config_dict = {"db_type": "neo4j", "url": "neo4j://localhost:7687"} config = ConnectionConfig.from_dict(config_dict)
-
Better Type Annotations
from typing import Dict, Optional # Types are now properly annotated def process_config(config: ConnectionConfig) -> Dict[str, Optional[str]]: return { "type": config.connection_type.value if config.connection_type else None, "url": config.url, "database": getattr(config, "database", None) }
-
Enhanced Error Handling
# More specific error messages try: config = ConnectionConfig.from_dict({"db_type": "unknown"}) except ValueError as e: print(e) # "Connection type 'unknown' not supported. Should be one of: ['arango', 'neo4j', 'wsgi']"
# Before
config = Neo4jConnectionConfig(hosts="http://localhost:7687", cred_name="neo4j", cred_pass="pass")
# After
config = Neo4jConnectionConfig(url="http://localhost:7687", username="neo4j", password="pass")# Before
config = ConfigFactory.create_config(dict_like={"db_type": "arango", "hosts": "http://localhost:8529"})
# After
config = ConfigFactory.create_config(dict_like={"db_type": "arango", "url": "http://localhost:8529"})
# Or more directly
config = ConfigFactory.create_config(url="http://localhost:8529")# Before
config_class = db_type.config_class()
# After
config_class = db_type.config_class- published on pypi
- FileHandle
- added support for reading .env files and pushing them to environment
- switched to python 3.10
- FileHandle
- added support for reading txt files by default
- if a single argument to FileHandle.load() is not named it is interpreted as filepath