Installation¶
This guide covers installing Aksara and its dependencies.
Requirements¶
| Dependency | Version | Notes |
|---|---|---|
| Python | 3.11+ | Required for modern async features |
| PostgreSQL | 13+ | Aksara is PostgreSQL-only |
| asyncpg | 0.29+ | Async PostgreSQL driver (auto-installed) |
| FastAPI | 0.104+ | Web framework (auto-installed) |
| Pydantic | 2.0+ | Data validation (auto-installed) |
Install Aksara¶
Using pip¶
Using uv (Recommended)¶
uv is a fast Python package installer:
Using Poetry¶
From Source¶
For development or the latest unreleased features:
Verify Installation¶
After installation, verify Aksara is available:
Expected output:
You can also check the Python package:
Install Development Dependencies¶
For development, testing, and code quality tools:
This includes:
| Package | Purpose |
|---|---|
| pytest | Testing framework |
| pytest-asyncio | Async test support |
| httpx | HTTP client for testing |
| black | Code formatting |
| ruff | Fast linting |
| mypy | Type checking |
| pre-commit | Git hooks |
PostgreSQL Setup¶
Aksara requires PostgreSQL. Here are common setup methods:
macOS (Homebrew)¶
Ubuntu/Debian¶
Docker¶
docker run -d \
--name aksara-postgres \
-e POSTGRES_PASSWORD=password \
-e POSTGRES_DB=myapp \
-p 5432:5432 \
postgres:15
Connection String Format¶
Aksara uses standard PostgreSQL connection strings:
Examples:
# Local with default user
postgresql://localhost/myapp
# With credentials
postgresql://postgres:password@localhost:5432/myapp
# Remote server
postgresql://user:secret@db.example.com:5432/production
Environment Variables¶
Aksara reads configuration from environment variables:
| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
PostgreSQL connection string | None |
AKSARA_DATABASE_URL |
Alternative DB URL (higher priority) | None |
AKSARA_DEBUG |
Enable debug mode | false |
AKSARA_LOG_LEVEL |
Logging level | INFO |
AKSARA_POOL_MIN_SIZE |
Min connection pool size | 5 |
AKSARA_POOL_MAX_SIZE |
Max connection pool size | 20 |
Create a .env file in your project root:
DATABASE_URL=postgresql://postgres:password@localhost:5432/myapp
AKSARA_DEBUG=true
AKSARA_LOG_LEVEL=DEBUG
IDE Setup¶
VS Code¶
Install the Python extension and add to .vscode/settings.json:
{
"python.analysis.typeCheckingMode": "basic",
"python.formatting.provider": "black",
"editor.formatOnSave": true,
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter"
}
}
PyCharm¶
- Open Settings → Project → Python Interpreter
- Add your virtual environment
- Enable Django-style support for similar patterns
Troubleshooting¶
asyncpg Installation Issues¶
On some systems, you may need PostgreSQL development headers:
Connection Refused¶
If you see "connection refused" errors:
-
Ensure PostgreSQL is running:
-
Check your connection string format
-
Verify credentials and database exists
Import Errors¶
If imports fail after installation:
# Ensure you're using the correct Python
which python
pip show aksara
# Reinstall if needed
pip uninstall aksara
pip install aksara-framework
Next Steps¶
With Aksara installed, proceed to:
- Project Layout — Understand the recommended structure
- Settings — Configure your application
- First App — Build your first Aksara application