Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datasette skeleton command for kick-starting database and table metadata #164

Closed
simonw opened this issue Dec 7, 2017 · 3 comments
Closed

Comments

@simonw
Copy link
Owner

simonw commented Dec 7, 2017

Generates an example metadata.json file populated with all of the databases and tables inspected from the specified databases.

@simonw simonw added this to the Custom templates edition milestone Dec 7, 2017
@simonw simonw closed this as completed in 32cf5a4 Dec 7, 2017
@simonw
Copy link
Owner Author

simonw commented Dec 7, 2017

Example usage:

datasette skeleton parlgov.db -m parlgov.json

Generates a parlgov.json file containing this:

{
    "title": null,
    "description": null,
    "description_html": null,
    "license": null,
    "license_url": null,
    "source": null,
    "source_url": null,
    "databases": {
        "parlgov": {
            "title": null,
            "description": null,
            "description_html": null,
            "license": null,
            "license_url": null,
            "source": null,
            "source_url": null,
            "queries": {},
            "tables": {
                "info_data_source": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_party_castles_mair": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_party_chess": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_party_huber_inglehart": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "info_table": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_party_euprofiler": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "party_family": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "info_id": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "sqlite_stat1": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_party_benoit_laver": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_country_iso": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "viewcalc_party_position": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "viewcalc_election_parameter": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "viewcalc_parliament_composition": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "viewcalc_country_year_share": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "election": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "politician_president": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "party_name_change": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_commissioner_doering": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_party_ray": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "party_change": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "cabinet_party": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_party_ees": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "party": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "external_party_cmp": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "country": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "cabinet": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "info_variable": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                },
                "election_result": {
                    "title": null,
                    "description": null,
                    "description_html": null,
                    "license": null,
                    "license_url": null,
                    "source": null,
                    "source_url": null
                }
            }
        }
    }
}

@simonw
Copy link
Owner Author

simonw commented Dec 7, 2017

This metadata doesn't yet do anything - need to implement #165

simonw added a commit that referenced this issue Dec 7, 2017
Also added support for descriptions and HTML descriptions.

Here's an example metadata.json file illustrating custom per-database and per-
table metadata:

    {
        "title": "Overall datasette title",
        "description_html": "This is a <em>description with HTML</em>.",
        "databases": {
            "db1": {
                "title": "First database",
                "description": "This is a string description & has no HTML",
                "license_url": "http://example.com/",
        		"license": "The example license",
                "queries": {
                	"canned_query": "select * from table1 limit 3;"
                },
                "tables": {
                    "table1": {
                        "title": "Custom title for table1",
                        "description": "Tables can have descriptions too",
                        "source": "This has a custom source",
                        "source_url": "http://example.com/"
                    }
                }
            }
        }
    }

Closes #165, Refs #164
@mroswell
Copy link
Sponsor Contributor

mroswell commented Mar 23, 2021

"datasette skeleton" feature removed #476

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants