<commit_before># Contributing to the Python Elasticsearch Client

If you have a bugfix or new feature that you would like to contribute to
elasticsearch-py, please find or open an issue about it first. Talk about what
you would like to do. It may be that somebody is already working on it, or that
there are particular issues that you should know about before implementing the
change.

We enjoy working with contributors to get their code accepted. There are many
approaches to fixing a problem and it is important to find the best approach
before writing too much code.

## Running Elasticsearch locally

We've provided a script to start an Elasticsearch cluster of a certain version
found at `.ci/run-elasticsearch.sh`.

There are several environment variables that control integration tests:

- `PYTHON_VERSION`: Version of Python to use, defaults to `3.9`
- `PYTHON_CONNECTION_CLASS`: Connection class to use, defaults to `Urllib3HttpConnection`
- `STACK_VERSION`: Version of Elasticsearch to use. These should be
  the same as tags of `docker.elastic.co/elasticsearch/elasticsearch`
  such as `8.0.0-SNAPSHOT`, `7.x-SNAPSHOT`, etc. Defaults to the
  same `*-SNAPSHOT` version as the branch.

**NOTE: You don't need to run the live integration tests for all changes. If
you don't have Elasticsearch running locally the integration tests will be skipped.**

## API Code Generation

All the API methods (any method in `elasticsearch.client` classes decorated
with `@query_params`) are actually auto-generated from the
[rest-api-spec](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/api)
found in the `Elasticsearch` repository. Any changes to those methods should be
done either by submitting a PR to Elasticsearch itself (in case of adding or
modifying any of the API methods) or to the [Generate
Script](https://github.com/elastic/elasticsearch-py/blob/master/utils/generate_api.py).

To run the code generation make sure you have pre-requisites installed:

* by running `python -m pip install -e '.[develop]'`
* having the [elasticsearch](https://github.com/elastic/elasticsearch) repo
  cloned on the same level as `elasticsearch-py` and switched to appropriate
  version

Then you should be able to run the code generation by invoking:
<commit_msg>Fix typo in URL for API generation script<commit_after># Contributing to the Python Elasticsearch Client

If you have a bugfix or new feature that you would like to contribute to
elasticsearch-py, please find or open an issue about it first. Talk about what
you would like to do. It may be that somebody is already working on it, or that
there are particular issues that you should know about before implementing the
change.

We enjoy working with contributors to get their code accepted. There are many
approaches to fixing a problem and it is important to find the best approach
before writing too much code.

## Running Elasticsearch locally

We've provided a script to start an Elasticsearch cluster of a certain version
found at `.ci/run-elasticsearch.sh`.

There are several environment variables that control integration tests:

- `PYTHON_VERSION`: Version of Python to use, defaults to `3.9`
- `PYTHON_CONNECTION_CLASS`: Connection class to use, defaults to `Urllib3HttpConnection`
- `STACK_VERSION`: Version of Elasticsearch to use. These should be
  the same as tags of `docker.elastic.co/elasticsearch/elasticsearch`
  such as `8.0.0-SNAPSHOT`, `7.x-SNAPSHOT`, etc. Defaults to the
  same `*-SNAPSHOT` version as the branch.

**NOTE: You don't need to run the live integration tests for all changes. If
you don't have Elasticsearch running locally the integration tests will be skipped.**

## API Code Generation

All the API methods (any method in `elasticsearch.client` classes decorated
with `@query_params`) are actually auto-generated from the
[rest-api-spec](https://github.com/elastic/elasticsearch/tree/master/rest-api-spec/src/main/resources/rest-api-spec/api)
found in the `Elasticsearch` repository. Any changes to those methods should be
done either by submitting a PR to Elasticsearch itself (in case of adding or
modifying any of the API methods) or to the [Generate
Script](https://github.com/elastic/elasticsearch-py/blob/master/utils/generate-api.py).

To run the code generation make sure you have pre-requisites installed:

* by running `python -m pip install -e '.[develop]'`
* having the [elasticsearch](https://github.com/elastic/elasticsearch) repo
  cloned on the same level as `elasticsearch-py` and switched to appropriate
  version

Then you should be able to run the code generation by invoking:

{'fraction_non_alphanumeric': 0.06872037914691943, 'fraction_numerical': 0.003015941404566997, 'mean_word_length': 4.669108669108669, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3547989', 'n_tokens_mistral': 1227, 'n_tokens_neox': 1232, 'n_words': 611}