{"id":36613426,"url":"https://github.com/breinify/brein-api-library-python","last_synced_at":"2026-01-12T09:02:58.242Z","repository":{"id":57416331,"uuid":"64878251","full_name":"Breinify/brein-api-library-python","owner":"Breinify","description":"Breinify's Python API Library","archived":false,"fork":false,"pushed_at":"2022-09-15T01:50:17.000Z","size":753,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-10-25T08:55:40.066Z","etag":null,"topics":["breinify","events","geocoding","holidays","ipaddress","ipaddress-to-address","ipaddresses","python","reverse-geocoding","temporal-data","time","timezone","weather"],"latest_commit_sha":null,"homepage":"https://www.breinify.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Breinify.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":"2016-08-03T20:46:50.000Z","updated_at":"2022-12-21T01:49:32.000Z","dependencies_parsed_at":"2022-09-16T08:52:42.838Z","dependency_job_id":null,"html_url":"https://github.com/Breinify/brein-api-library-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Breinify/brein-api-library-python","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Breinify%2Fbrein-api-library-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Breinify%2Fbrein-api-library-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Breinify%2Fbrein-api-library-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Breinify%2Fbrein-api-library-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Breinify","download_url":"https://codeload.github.com/Breinify/brein-api-library-python/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Breinify%2Fbrein-api-library-python/sbom","scorecard":{"id":24329,"data":{"date":"2025-08-11","repo":{"name":"github.com/Breinify/brein-api-library-python","commit":"32d34b67625ea381d345eba2b5a65d1f055b2618"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-14T17:30:18.172Z","repository_id":57416331,"created_at":"2025-08-14T17:30:18.172Z","updated_at":"2025-08-14T17:30:18.172Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["breinify","events","geocoding","holidays","ipaddress","ipaddress-to-address","ipaddresses","python","reverse-geocoding","temporal-data","time","timezone","weather"],"created_at":"2026-01-12T09:02:57.470Z","updated_at":"2026-01-12T09:02:58.237Z","avatar_url":"https://github.com/Breinify.png","language":"Python","readme":".. raw:: html\n\n   \u003cp align=\"center\"\u003e\u003cimg src=\"https://www.breinify.com/img/Breinify_logo.png\" alt=\"Breinify API Python Library\" width=\"250\"\u003e\u003c/p\u003e\n\n.. raw:: html\n\n   \u003cdiv\u003e\n     \u003ca href=\"https://pypi.python.org/pypi/brein-api/\"\u003e\n       \u003cimg src=\"https://img.shields.io/pypi/v/brein-api.svg\" alt = \"Current Version\" style=\"float: left;\"/\u003e\n     \u003c/a\u003e\n     \u003ca href=\"https://github.com/Breinify/brein-api-library-python/blob/master/LICENSE\"\u003e\n       \u003cimg src=\"https://img.shields.io/pypi/l/brein-api.svg\" alt = \"MIT\"/\u003e\n     \u003c/a\u003e\n     \u003csup\u003eFeatures: \u003cb\u003eTemporal Data, (Reverse) Geocoding, Events, Weather, Holidays, Analytics\u003c/b\u003e\u003c/sup\u003e\n   \u003c/div\u003e\u003c/br\u003e\n\nThis library simplifies access to Breinify's API for tasks like geocoding, reverse geocoding, weather and events look up, and holidays determination based on information such as a user's ip address, coordinates, or reported location.  In addition, this documentation gives detailed examples for each of the features available for the different endpoints.\n\n**TemporalData Endpoint:** The endpoint offers features to resolve temporal information like a timestamp, a location (latitude and longitude or free-text), or an IP-address, to temporal information (e.g., timezone, epoch, formatted dates, day-name), holidays at the specified time and location, city, zip-code, neighborhood, country, or county of the location, events at the specified time and location (e.g., description, size, type), weather at the specified time and location (e.g., description, temperature).\n\n**Activity Endpoint:** The endpoint is used to understand the usage-patterns and the behavior of a user using, e.g., an application, a mobile app, or a web-browser. The endpoint offers analytics and insights through Breinify's dashboard.\n\nQuickstart\n==========\n\nStep 1: Download the Library\n----------------------------\nDownload the library from PyPi and install it with\n\n.. code:: bash\n\n    pip3 install brein-api\n\nor download the source from github and run\n\n.. code:: python\n\n    python3 setup.py install\n\n\nStep 2: Integrate the Library\n-----------------------------\nIntegrate the Library into your Python 3 project by importing the library in the relevant blocks of code.\n\n.. code:: python\n\n    import breinify\n\n\n\nStep 3: Configure the Library\n-----------------------------\n\nIn order to use the library you need a valid API-key, which you can get for free at https://www.breinify.com. In this example, we assume you have the following api-key:\n\n**938D-3120-64DD-413F-BB55-6573-90CE-473A**\n\nAdditionally, you can supply an optional secret, which is recommended for the Python library. Here, we'll use this secret:\n\n**utakxp7sm6weo5gvk7cytw==**\n\n.. code:: python\n\n    from breinify import Breinify\n\n    # This is a valid API key\n    apiKey = \"938D-3120-64DD-413F-BB55-6573-90CE-473A\"\n    secret = \"utakxp7sm6weo5gvk7cytw==\"\n\n    brein = Breinify(apiKey, secret)\n\n\nThe Breinify class is now configured with a valid configuration object.\n\n\nStep 4: Start Using the library\n-------------------------------\n\nTemporal Data Lookup\n^^^^^^^^^^^^^^^^^^^^\n\n\nLooking up a User's Location's Info\n+++++++++++++++++++++++++++++++++++\n\nYou may want to enrich a user information or customize their experience based on where they are. For example calling\n\n.. code:: python\n\n    # Create a user you are interested in based on their ip.\n    # Other fields (coordinates, time, etc) can also be included\n    example_user = User(ip = \"143.127.128.10\")\n\n    result = brein.temporal_data(example_user)\n\nwill result in a dictionary of timely information for the location the ip address resolves to (San Jose), for example:\n\n.. code:: python\n\n    # Wrap the result in json.dumps() for readability\n    print(json.dumps(result, indent = 4))\n\nWhich will print:\n\n.. raw:: html\n\n   \u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/Breinify/brein-api-library-python/master/documentation/img/sample_response.png\" alt=\"sample output\" width=\"400\"\u003e\u003c/p\u003e\n\n\nLooking up Information About a Location\n+++++++++++++++++++++++++++++++++++++++\n\nInstead of looking up information based off a user's location, you can just supply the location's information directly.\nFor example, you could get yesterday's weather in San Francisco by running:\n\n.. code:: python\n\n    from breinify import Breinify\n    import time\n    import math\n\n    apiKey = \"938D-3120-64DD-413F-BB55-6573-90CE-473A\"\n\n    brein = Breinify(apiKey)\n\n    yesterday = math.floor(time.time()) - 24 * 60 * 60\n\n    result = brein.temporal_data(location_free_text = \"San Francisco, CA\",\n                                 unixtime = yesterday)\n\n    print(\"Yesterday in %s, the weather was %s with a temperature of %d F.\"%\n             (result['location']['city'],\n              result['weather']['description'],\n              result['weather']['temperatureF']))\n\nWhich will output:\n\nYesterday in **San Francisco**, the weather was **overcast clouds** with a temperature of **64** F.\n\nReverse Geocoding\n+++++++++++++++++\n\nWe support looking up locations based on latitude and longitude and provide both information about the location and relevant shape files. For example\n\n.. code::\n\n    florida = brein.temporal_data(location_longitude=lon, location_latitude=lat, location_shapes = [\"CITY\",\"STATE\"])\n\nwill return both\n\n.. raw:: html\n\n   \u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/Breinify/brein-api-library-python/master/documentation/img/sample_location_json.png\" alt=\"A sample json response\" width=\"250\"\u003e\u003c/p\u003e\n\nand the shape file to draw\n\n.. raw:: html\n\n   \u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/Breinify/brein-api-library-python/master/documentation/img/florida.png\" alt=\"A map of Florida\" width=\"350\"\u003e\u003c/p\u003e\n\n\n* The full code for this example is available `here`__\n\n.. __: https://github.com/Breinify/brein-api-library-python/blob/master/documentation/additional/point2shape.py\n\n\nPlacing Activity Triggers\n^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe API provides support for analytics based on user behavior on your site or app by sending user activities to the `/activity` endpoint. Since the `/activity` endpoint only consumes data, calls to it in the Python library are sent asynchronously.\n\nFor this example, pretend that a user named \"John Doe\" is logged in to your site with his email address, ``john.doe@email.com``, is viewing the page \"www.example.com\". You can log this by executing:\n\n.. code:: python\n\n    from breinify import User\n    # Create a user you are interested in with their email and last name\n    example_user = User(email = \"john.doe@email.com\")\n\n    brein.send_activity(example_user, \"pageView\", url = \"www.example.com\")\n\nThe call will then be run asynchronously in the background.\n\n\nFurther links\n-------------\n\nTo understand all the capabilities of Breinify's DigitalDNA API, take a look at:\n\n*  `Additional Code Samples`__\n\n.. __: https://github.com/Breinify/brein-api-library-python/tree/master/documentation/additional\n\n*  `Breinify's Website`__\n\n.. __: https://www.breinify.com\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreinify%2Fbrein-api-library-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbreinify%2Fbrein-api-library-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbreinify%2Fbrein-api-library-python/lists"}