Skip to main content

License PyPI License

What is pisql ?

pisql is a mix of a command line tool and a small python library to interact with a Sybase ASE database.
It so happens, that I have to work with a Sybase ASE database and I wanted to have a tool to interact with it.

But why ?

The reason I built this is fairly simple although frustrating:

  • My company has tight control over what gets installed on the workstations
  • My company hasn't bought the SQL Anywhere drivers for ASE on top of ASE itself as of today
  • The only way I have to interact with the database is through a very old and ugly piece of software called "sqlDbx".
  • I wanted to have scripting and automation capabilities that the interface couldn't provide, but that bash/powershell/python could.

What is it ?

pisql is, for the CLI part, a rich CLI wrapper around the barebones isql command line tool that comes with the ASE installation every time.

For the python part, it's a small library that allows you to interact with the database through python code. You can turn .sql files into dataframes (pandas or polars), and further manipulate them. You can use every tool you have in python to interact with the data, vizualize it, etc.

How do I use it ?

Installation

You can install pisql through pip:

    pip install pisql

Although I recommend pipx:

    pipx install pisql

This works on Windows, Linux and MacOS.

Usage

CLI

The CLI is fairly simple to use.

To execute a single .sql file, you can just use the exec command:

    pisql exec my_file.sql

which is also aliased to pisql e my_file.sql and pisql x my_file.sql.

To execute multiple .sql files, you can use what I call the "query mode" or "run mode", using either
the symbols q, run or ::. Once this more is activated, you can chain multiple executions together
by using the ++ or // commands:

    pisql q ++ file_one.sql file_two.sql file_three.sql

An important feature of this mode, is that you can list both files and directories.

    pisql :: // file.sql some_dir other_file.sql

What happens then is that pisql will execute sequentially:

  • file.sql first
  • then all the .sql files in some_dir second
  • then other_file.sql last

One nice feature is the presence of rich progress bars like so (give example)

NB: I haven't had the time to implement further recursion, so if you have a directory in some_dir, it will be ignored.

Python

Will explain in the next few days.

What's next ?

I'm currently working on a few things:

  • Implementing a config file subcommand to set the default database, user, etc.
  • Give more freedom to users to change the storage of the dataframes and config files
  • Build a semi ORM to interact with the database through python. Comes to mind the SELECT, WHERE, JOIN, etc. clauses.
  • Have a little templating feature, but nothing too fancy. I don't want to reinvent the wheel here.
  • Use Agg-Grid to have a web interface to interact with the database. I'm not sure how to do this yet, but I'll figure it out.

Here's most of it for now ! I'll update this as I go.

Metadata

Release files for pisql 0.1.31.post12

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pisql 0.1.31.post12
File Size Uploaded Provenance Actions
pisql-0.1.31.post12.tar.gz 13.9 kB Without provenance Details for pisql-0.1.31.post12.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pisql 0.1.31.post12
File Interpreter ABI Platform Actions
pisql-0.1.31.post12-py3-none-any.whl Python 3 none any Details for pisql-0.1.31.post12-py3-none-any.whl

Total release size: 33.7 kB

Release files / pisql-0.1.31.post12.tar.gz

Download URL pisql-0.1.31.post12.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b9501afcbe5fb824f494cc3749210a70e353c9b40c6eaef9fa7e8b9d76c100ba
BLAKE2b-256 checksum
How to use checksums
485a90614bfb53afcf7d3bb6e18f540074dda974d8408d08c90d414d4b6bc8b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.9.13 Windows/10

Release files / pisql-0.1.31.post12-py3-none-any.whl

Download URL pisql-0.1.31.post12-py3-none-any.whl
Size 19.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d0c8fe2ad301c43621fd3856d3f15bf295f7eaaf113a4bdf683e6677a7088b4c
BLAKE2b-256 checksum
How to use checksums
f2fb9b1adc6675ac80e9d22ef36cf43f665da1c30118cc5a54339164481b0e94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.9.13 Windows/10

Security for pisql 0.1.31.post12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page