Last active
June 18, 2018 21:29
-
-
Save vb100/a8beb7624e04508924c12f87bc677dac to your computer and use it in GitHub Desktop.
Viewing Table Details
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
['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)