diff --git a/README.md b/README.md index 62a3c98..b4cb86f 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ $ pip install git+https://github.com/networktocode/diffsync.git@main # Contributing Pull requests are welcomed and automatically built and tested against multiple versions of Python through GitHub Actions. -The project is following Network to Code software development guidelines and are leveraging the following: +The project is following Network to Code software development guidelines and is leveraging the following: - Black, Pylint, Bandit, flake8, and pydocstyle, mypy for Python linting, formatting and type hint checking. - pytest, coverage, and unittest for unit tests. diff --git a/diffsync/__init__.py b/diffsync/__init__.py index abe5273..6172824 100644 --- a/diffsync/__init__.py +++ b/diffsync/__init__.py @@ -61,7 +61,7 @@ class DiffSyncModel(BaseModel): """Base class for all DiffSync object models. - Note that read-only APIs of this class are implemented as `get_*()` functions rather than as properties; + Note that read-only APIs of this class are implemented as `get_*()` methods rather than as properties; this is intentional as specific model classes may want to use these names (`type`, `keys`, `attrs`, etc.) as model attributes and we want to avoid any ambiguity or collisions. diff --git a/docs/source/core_engine/02-customize-diff-class.md b/docs/source/core_engine/02-customize-diff-class.md index 5079d9e..159969e 100644 --- a/docs/source/core_engine/02-customize-diff-class.md +++ b/docs/source/core_engine/02-customize-diff-class.md @@ -17,9 +17,9 @@ To use your own diff class, you need to provide it at runtime when calling one o ``` -## Change the order in which the element are being processed +## Change the order in which the elements are being processed -By default, all objects of the same type will be stored in a dictionary and as such the order in which they will be processed during a diff or a sync operation is not guaranteed (although in most cases, it will match the order in which they were initially loaded and added to the adapter). When the order in which a given group of object should be processed is important, it's possible to define your own ordering inside a custom Diff class. +By default, all objects of the same type will be stored in a dictionary and as such the order in which they will be processed during a diff or a sync operation is not guaranteed (although in most cases, it will match the order in which they were initially loaded and added to the adapter). When the order in which a given group of objects should be processed is important, it's possible to define your own ordering inside a custom Diff class. When iterating over a list of objects, either at the top level or as a group of children of a given object, the core engine is looking for a function named after the type of the object `order_children_` and if none is found it will rely on the default function `order_children_default`. Either function need to be present and need to return an Iterator of DiffElement. diff --git a/docs/source/getting_started/01-getting-started.md b/docs/source/getting_started/01-getting-started.md index d6bc2b5..0e609a1 100644 --- a/docs/source/getting_started/01-getting-started.md +++ b/docs/source/getting_started/01-getting-started.md @@ -111,7 +111,7 @@ class Nautobot(Adapter): ``` -Would result in processing in the following order for each element until there is no elements left: +Would result in processing in the following order for each element until there are no elements left: - site - vlan @@ -145,7 +145,7 @@ NetworkImporterAdapter >>> ``` -# Store data in a `Adapter` object +# Store data in an `Adapter` object To add a site to the local cache/store, you need to pass a valid `DiffSyncModel` object to the `add()` function. diff --git a/examples/03-remote-system/README.md b/examples/03-remote-system/README.md index eaff714..321beda 100644 --- a/examples/03-remote-system/README.md +++ b/examples/03-remote-system/README.md @@ -6,11 +6,11 @@ This is a simple example to show how DiffSync can be used to compare and synchro For this example, we have a shared model for Region and Country defined in `models.py`. A country must be part of a region and has an attribute to capture its population. -The comparison and synchronization of dataset is done between a local JSON file and the [public instance of Nautobot](https://demo.nautobot.com). +The comparison and synchronization of datasets is done between a local JSON file and the [public instance of Nautobot](https://demo.nautobot.com). Also, this example is showing : -- How to set a Global Flags to ignore object that are not matching -- How to provide a custom Diff class to change the ordering of a group of object +- How to set Global Flags to ignore objects that are not matching +- How to provide a custom Diff class to change the ordering of a group of objects > The source code for this example is in Github in the [examples/03-remote-system/](https://github.com/networktocode/diffsync/tree/main/examples/03-remote-system) directory. diff --git a/examples/05-nautobot-peeringdb/README.md b/examples/05-nautobot-peeringdb/README.md index c2c58c0..0013d0c 100644 --- a/examples/05-nautobot-peeringdb/README.md +++ b/examples/05-nautobot-peeringdb/README.md @@ -2,7 +2,7 @@ ## Context -The goal of this example is to synchronize some data from [PeeringDB](https://www.peeringdb.com/), that as the name suggests is a DB where peering entities define their facilities and presence to facilitate peering, towards [Nautobot Demo](https://demo.nautobot.com/) that is a always on demo service for [Nautobot](https://nautobot.readthedocs.io/), an open source Source of Truth. +The goal of this example is to synchronize some data from [PeeringDB](https://www.peeringdb.com/), as the name suggests that is a DB where peering entities define their facilities and presence to facilitate peering, towards [Nautobot Demo](https://demo.nautobot.com/) that is an always on demo service for [Nautobot](https://nautobot.readthedocs.io/), an open source Source of Truth. In Peering DB there is a model that defines a `Facility` and you can get information about the actual data center and the city where it is placed. In Nautobot, this information could be mapped to the `Region` and `Site` models, where `Region` can depend from other `Region` and also contain `Site` as children. For instance, Barcelona is in Spain and Spain is in Europe, and all of them are `Regions`. And, finally, the actual datacenter will refer to the `Region` where it is placed.