Skip to main content

michraz

PyPI Python CI License: MIT

Israeli public tenders (מכרזים) in Python. One Tender object, whichever site it came from.

Sources today: Israel Land Authority land tenders, central-government tenders (mr.gov.il), Beer Sheva, and 12 more municipalities (Akko, Arad, Beit Shemesh, Dimona, Kfar Saba, Kiryat Motzkin, Nesher, Netivot, Nof HaGalil, Savyon, Tamra, Yavne). The first search takes around 20 seconds because mr.gov.il is read page by page. After that the responses are cached for an hour.

Unofficial client. It can lag or miss tenders, and parsing can break when a source changes. Confirm deadlines on the publisher's page before you act. Not affiliated with the Israel Land Authority or any municipality.

michraz architecture: how one search reaches the data and comes back

Edit in draw.io

Install

pip install michraz            # Python 3.10+
pip install "michraz[pandas]"  # optional, for DataFrames

Use it

from michraz import Michraz, to_csv

with Michraz() as m:
    tenders = m.search(keyword="גינון", open_only=True)

for t in tenders:
    print(f"{t.deadline:%Y-%m-%d}  {t.title}  {t.url}")

to_csv(tenders, "tenders.csv")

Results are sorted by deadline. Filter by source, closing_before and closing_after (dates or aware datetimes) too. Each tender has an attribution string. Keep it when you republish the data.

Some city sites list staff vacancies next to their tenders. They are hidden by default. Pass kind=None to see both, or --kind all on the command line.

Or from the terminal:

michraz search --open --source rmi
michraz search --keyword גינון --csv gardening.csv

michraz search in the terminal

A record that fails to parse is skipped and listed in m.last_errors. If one source is down, the others still answer and its error is listed there too. SourceUnavailableError is raised only when every searched source fails.

More scripts are in examples.

Add a source

Subclass BaseSource. Say how to read the records and how to turn one into a Tender. Skipping bad records, reporting them in errors and dropping repeats is shared.

from michraz.sources import BaseSource


class MySource(BaseSource[dict]):
    name = "my-city"
    description = "My city's tenders"
    attribution = "My City, my-city.example"

    def records(self):
        yield from self._client().get_json(self.name, "https://my-city.example/api/tenders")

    def parse(self, record):
        return Tender(source=self.name, source_id=record["id"], title=record["title"], attribution=self.attribution)

Then Michraz([MySource()]). A city that uses the shared /bids/ page needs only a name, a publisher and a domain (see michraz/sources/municipal.py).

Class diagram: sources and the Tender model

Edit in draw.io

Fields are documented in docs/model.md, and how each source was checked in docs/sources.md.

Polite by default

Flowchart: what happens during one search

Edit in draw.io

Honest User-Agent, one request per second per host, one-hour disk cache, at most two retries. Tune it with Michraz(cache_dir=None, cache_ttl=..., min_interval=...).

Limitations

  • RMI region, type, purpose and status are raw numeric codes in tender.extra. No verified label table exists.
  • RMI tender details and documents are not fetched yet.
  • Keyword search is a Unicode-normalized substring match. No stemming.

Development

make venv && make check
make diagrams   # re-export the PNGs from docs/diagrams (needs draw.io desktop and Graphviz)

See CONTRIBUTING.md.

MIT licensed. The data belongs to its publishers and carries their licenses.

Metadata

Release files for michraz 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for michraz 0.2.0
File Size Uploaded Provenance Actions
michraz-0.2.0.tar.gz 63.8 kB Without provenance Details for michraz-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for michraz 0.2.0
File Interpreter ABI Platform Actions
michraz-0.2.0-py3-none-any.whl Python 3 none any Details for michraz-0.2.0-py3-none-any.whl

Total release size: 115.1 kB

Release files / michraz-0.2.0.tar.gz

Download URL michraz-0.2.0.tar.gz
Size 63.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b4e3b4442305e47f366fdf8dd979cd0004ec63e7bbdc57b8f053080cd835ae4a
BLAKE2b-256 checksum
How to use checksums
5e8dbb469e6fa5bec1802179ec5d2773132d55f66bf9e30c9e0b79f7a4971208
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / michraz-0.2.0-py3-none-any.whl

Download URL michraz-0.2.0-py3-none-any.whl
Size 51.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
86a7ccf43377b88f1f9395af655bcf37b67eec64c8238bee81d0ccd7505fbada
BLAKE2b-256 checksum
How to use checksums
f785a7cc78f1bd0e305843443ffdb8aeb766d9ff6817c130e3c768451ce5f5a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for michraz 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page