{"id":23594409,"url":"https://github.com/andychase/reddit-cssfilter","last_synced_at":"2025-11-04T15:30:30.476Z","repository":{"id":62584412,"uuid":"45810334","full_name":"andychase/reddit-cssfilter","owner":"andychase","description":"(Forked from reddit) Parse and validate a safe subset of CSS","archived":false,"fork":false,"pushed_at":"2015-11-17T02:59:04.000Z","size":13,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-27T14:03:59.330Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andychase.png","metadata":{"files":{"readme":"readme.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-09T02:32:19.000Z","updated_at":"2021-01-18T16:06:24.000Z","dependencies_parsed_at":"2022-11-03T22:18:30.542Z","dependency_job_id":null,"html_url":"https://github.com/andychase/reddit-cssfilter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andychase%2Freddit-cssfilter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andychase%2Freddit-cssfilter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andychase%2Freddit-cssfilter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andychase%2Freddit-cssfilter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andychase","download_url":"https://codeload.github.com/andychase/reddit-cssfilter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239435224,"owners_count":19638082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-27T09:18:17.791Z","updated_at":"2025-11-04T15:30:30.422Z","avatar_url":"https://github.com/andychase.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"reddit-cssfilter\n================\n\n|Build Status|\n\ncssfilter.py extracted from reddit's source code.\n\nThis library allows you to filter \"unsafe\" css from your users.\n\n**This library requires attribution!:**\n\nWhen using this library, reddit requires you to put the following information in the splash or the \"about\" section of your application.\n\n\tEXHIBIT B. Attribution Information\n\n\tAttribution Copyright Notice: Copyright (c) 2006-2015 reddit Inc. All Rights\n\tReserved.\n\n\tAttribution Phrase (not exceeding 10 words): Powered by reddit\n\n\tAttribution URL: http://code.reddit.com\n\n\tGraphic Image as provided in the Covered Code:\n\thttp://code.reddit.com/reddit_logo.png\n\nInfo\n~~~~\n\nParse and validate a safe subset of CSS.\n\nThe goal of this validation is not to ensure functionally correct stylesheets\nbut rather that the stylesheet is safe to show to downstream users.  This\nincludes:\n\n* not generating requests to third party hosts (information leak)\n* xss via strange syntax in buggy browsers\n\nBeyond that, every effort is made to allow the full gamut of modern CSS.\n\nInstallation\n~~~~~~~~~~~~\n\n.. code-block:: bash\n\n\tpip install reddit-cssfilter\n\n\nHow to use\n~~~~~~~~~~\n\n.. code-block:: python\n\n\timport reddit_cssfilter.cssfilter\n\tcssfilter.validate_css(stylesheet, images)\n\n..\n\n\tValidate and re-serialize the user submitted stylesheet.\n\t\n\timages is a mapping of subreddit image names to their URLs.  The\n\tre-serialized stylesheet will have %%name%% tokens replaced with their\n\tappropriate URLs.\n\t\n\tThe return value is a two-tuple of the re-serialized (and minified)\n\tstylesheet and a list of errors.  If the list is empty, the stylesheet is\n\tvalid.\n\n\nLicence\n~~~~~~~\n\nCopyright (c) 2006-2015 reddit Inc. All Rights Reserved.\n\nCommon Public Attribution License Version 1.0 (CPAL)\n\nThe full license is available here: `reddit Inc. Common Public Attribution License Version 1.0 (CPAL) \u003chttp://code.reddit.com/LICENSE\u003e`_.\n\n.. |Build Status| image:: https://travis-ci.org/andychase/reddit-cssfilter.svg?branch=master\n   :target: https://travis-ci.org/andychase/reddit-cssfilter\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandychase%2Freddit-cssfilter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandychase%2Freddit-cssfilter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandychase%2Freddit-cssfilter/lists"}