Coder Social home page Coder Social logo

cssho / pg-table-markdown Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vokal/pg-table-markdown

0.0 2.0 0.0 16 KB

A command line tool that generates markdown documentation for Postgres tables in a given schema

License: MIT License

Python 100.00%

pg-table-markdown's Introduction

A command line tool that generates Markdown documentation for Postgres tables in a given schema.

Installation

pip install pg-table-markdown

Note: Since pg-table-markdown is intended to connect to Postgres databases, it has a dependedncy on psycopg2. However, psycopg2 includes compiled C modules, and therefore may require compiling from source if it's not already installed. Installing via pip will require python-dev and libpq-dev. psycopg2 maintainers generally recommend installing from binary instead.

Usage

Usage: pgtablemd [OPTIONS]

  Export Postgres table documentation to a markdown file

Options:
  --database_url TEXT  Database connection URL
  --table_schema TEXT  Postgres table_schema, default is: public
  --output_file TEXT   Path for generated markdown file
  --help               Show this message and exit.

Note: For those unfamiliar with Postgres database connection URLs, they use the following format:

postgres://username:password@host:port/dbname

Sample Output

The generated Markdown details the column name, type, and default value for each table defined in your schema. It also displays nicely in GitHub (see more here).

app_users

Column Type Default Nullable
id integer nextval('app_users_id_seq'::regclass) NO
email character varying None NO
password character varying None YES
is_active boolean true YES
is_admin boolean false YES

Run tests with Docker Compose

docker-compose run cli nosetests -v

pg-table-markdown's People

Contributors

foresmac avatar fpietka avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.