Skip to content

Instantly share code, notes, and snippets.

@vb100
Last active June 18, 2018 21:29
Show Gist options
  • Save vb100/a8beb7624e04508924c12f87bc677dac to your computer and use it in GitHub Desktop.
Save vb100/a8beb7624e04508924c12f87bc677dac to your computer and use it in GitHub Desktop.
Viewing Table Details
# Reflect the census table from the engine: census
census = Table('census', metadata, autoload=True, autoload_with=engine)
# Print the column names
print(census.columns.keys())
# Print full table metadata
print(repr(metadata.tables['census']))
@vb100
Copy link
Author

vb100 commented Jun 18, 2018

['state', 'sex', 'age', 'pop2000', 'pop2008']
Table('census', MetaData(bind=None), Column('state', VARCHAR(length=30), table=), Column('sex', VARCHAR(length=1), table=), Column('age', INTEGER(), table=), Column('pop2000', INTEGER(), table=), Column('pop2008', INTEGER(), table=), schema=None)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment