
Product
Introducing the Alert Details Page: A Better Way to Explore Alerts
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.
alphaz-next
Advanced tools
Alphaz-Next is a Python library designed to simplify the setup of REST APIs using FastAPI & Pydantic. It provides a useful toolkit for setting up Logger, Config, and more.
To install alphaz-next, if you already have Python, you can install with:
pip install alphaz-next
To use Alphaz-Next in your Python code, import the necessary classes and functions like this:
from alphaz-next import DataBase, Logger
from alphaz-next.models.config.config_settings import create_config_settings
The Logger class provides a custom logging functionality with various log levels and output options. It is imported from the alphaz_next.utils.logger module.
The Logger class is initialized with the following parameters:
name (str): The name of the logger.directory (str): The directory where the log files will be stored.level (int, optional): The log level. Defaults to logging.INFO.stream_output (bool, optional): If set to True, the logs will also be output to the console. Defaults to True.when (str, optional): Specifies when to rotate the log file. Defaults to "midnight".interval (int, optional): The interval at which the log file should be rotated. Defaults to 1.backup_count (int, optional): The number of backup log files to keep. Defaults to 10.file_name (str, optional): The name of the log file. If not provided, the log file will be named after the logger. Defaults to None.logging_formatter (str, optional): The format string for the log messages. Defaults to DEFAULT_FORMAT.date_formatter (str, optional): The format string for the date in the log messages. Defaults to DEFAULT_DATE_FORMAT.Here's an example of how to use the Logger class:
from alphaz_next.utils.logger import Logger
logger = Logger(
name="my_logger",
directory="/path/to/log/files",
level=logging.INFO,
stream_output=True,
when="midnight",
interval=1,
backup_count=10,
file_name=None,
logging_formatter=DEFAULT_FORMAT,
date_formatter=DEFAULT_DATE_FORMAT
)
logger.info("This is an info log message.")
The Database class represents a database connection and provides methods for various database operations.
The Database class is initialized with the following parameters:
Here's an example of how to use the DataBase class:
from alphaz_next import DataBase, Logger
# Initialize the logger
logger = Logger(
name='sqlalchemy.engine',
file_name="database",
stream_output=False,
level=logging.DEBUG
)
# Create the database configuration
databases_config = {
"mydb1": {
"host": "srv-mydb1-db-dev.example.com",
"password": "MyDB1Dev_123",
"username": "mydb1adm",
"port": 1234,
"driver": "oracledb",
"service_name": "mydb1",
"ini": false
},
"mydb2": {
"path": "{{project}}/mydb2.sqlite",
"driver": "sqlite",
"ini": true,
"init_database_dir_json": "{{project}}/tests/mydb2/ini",
"connect_args": {
"check_same_thread": false
}
}
}
# Initialize the database connection
database = DataBase(
databases_config=databases_config,
logger=logger,
base=Base
)
# Use the database connection
with database.session_factory() as session:
# Perform database operations...
FAQs
A project to make a lib to start FastAPI quickly
We found that alphaz-next demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket's new Alert Details page is designed to surface more context, with a clearer layout, reachability dependency chains, and structured review.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.