
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
A yhttp
extension to create and remove database(s) using command line and
API.
Install postgresql
brefore use of this project.
apt install postgresql
Create and grant the postgresql
role with createdb
permission to
authenticate the current unix
user within postgresql
using the peer
authentication.
echo "CREATE USER ${USER} WITH CREATEDB" | sudo -u postgres psql
# Or
echo "ALTER USER ${USER} CREATEDB" | sudo -u postgres psql
Import and install the extension inside the roolup.py
:
# foo/version.py
__version__ = '0.1.'
# foo/rollup.py
from yhttp.core import Application
from yhttp.ext import dbmanager
from .version import __version__
app = Application(__version__, 'foo')
# builtin settings
app.settings.merge('''
db:
url: postgres://:@/ticketing
```)
# install extensions
dbmanager.install(app)
# http handlers
from . import handlers
# foo/__init__.py
from .version import __version__
from .rollup import app
# setup.py
import re
from os.path import join, dirname
from setuptools import setup, find_packages
# reading package version (same way the sqlalchemy does)
with open(join(dirname(__file__), 'foo/version.py')) as v_file:
package_version = re.compile('.*__version__ = \'(.*?)\'', re.S).\
match(v_file.read()).group(1)
dependencies = [
'yhttp >= 7.0.1, < 8'
'yhttp-dbmanager >= 5.0.1, < 6'
]
setup(
name='foo',
version=package_version,
install_requires=dependencies,
packages=find_packages(
where='.',
exclude=['tests']
),
entry_points={
'console_scripts': [
'foo = foo:app.climain'
]
},
)
After installing the extension these command line interfaces will be available as as subcommand of your application command line interface:
foo db --help
Install postgresql
brefore use of this project.
apt install postgresql
Create and grant the postgresql
role with createdb
permission to
authenticate the current unix
user within postgresql
using the peer
authentication.
echo "CREATE USER ${USER} WITH CREATEDB" | sudo -u postgres psql
# Or
echo "ALTER USER ${USER} CREATEDB" | sudo -u postgres psql
Create virtual environment:
make venv
Delete virtual environment:
make venv-delete
Activate the virtual environment:
source ./activate.sh
Install this project as editable mode and all other development dependencies:
make env
Execute all tests:
make test
Execute specific test(s) using wildcard:
make test F=tests/test_db*
make test F=tests/test_form.py::test_querystringform
refer to pytest documentation for more info about invoking tests.
Execute tests and report coverage result:
make cover
make cover F=tests/test_static.py
make cover-html
make lint
Execute these commands to create Python
's standard distribution packages
at dist
directory:
make sdist
make wheel
Or
make dist
to create both sdidst
and wheel
packages.
Execute:
make clean
to clean-up previous dist/*
and build/*
directories.
WARNING: Do not do this if you'r not responsible as author and or maintainer of this project.
Execute
make clean
make pypi
to upload sdists
and wheel
packages on PyPI.
FAQs
Database manager command line interface and API for yhttp.
We found that yhttp-dbmanager 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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.