-
Notifications
You must be signed in to change notification settings - Fork 28.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
There is no Python library for chapter 11 and chapter 15. #413
Comments
👋 Thanks for contributing @nitinkhandelwal26! We will review the issue and get back to you soon. |
Thanks for reporting, will look into this! |
Step 1: Understanding the Missing Content
Step 2: Gather Necessary Tools and Resources
Step 3: Develop or Locate Code Examples
Step 4: Integrate with Documentation
Step 5: Review and Test
Step 6: Submit Pull Request (PR)
By iteratively refining and enhancing each step, you ensure that your approach is not only thorough but also aligns well with best practices in software development and documentation. |
Hi @koreyspace , We are going through the chapter 11 and wanted to try sample code provided by you. But this code uses BING maps URL. We were trying to create new BING maps account but it's not allowing to create new account. Do you have any other option or example code where we can use another API for hands on for this "Function calling" Ai feature? ![]() |
Hey @Abhijitk914 - can you explain a bit more of when you need the Bing Maps API when running the code? The code should only be using the Microsoft API - |
7-Word Title:Access Microsoft API Data Efficiently and Easily 77-Word Summary:This Python script demonstrates how to retrieve data from the Microsoft API using the Enhanced Code:import requests
import json
# Define the API URL
url = "https://learn.microsoft.com/api/catalog/"
# Send the GET request
response = requests.get(url)
# Check the response status code
if response.status_code == 200:
print("Request was successful!")
# Parse and print the JSON data
data = response.json() # Parse JSON data from the response
print(json.dumps(data, indent=4)) # Pretty-print the JSON data for readability
else:
print(f"Request failed with status code: {response.status_code}")
# Explanation:
# 1. Import Modules: Import the necessary libraries for making HTTP requests and handling JSON data.
# 2. Define URL: Specify the endpoint for the Microsoft API.
# 3. Send Request: Use the `requests.get()` method to retrieve data from the API.
# 4. Check Status: Ensure the request was successful by checking the status code (200).
# 5. Parse Data: If successful, parse the JSON data from the response.
# 6. Print Data: Display the parsed JSON data in a readable format. Detailed Steps:
Recap:By following these detailed steps and using the provided code, you can efficiently and easily access and display data from the Microsoft API. This guide is designed to be beginner-friendly, ensuring that even those new to programming can understand and implement it. |
Hi @koreyspace , I am referring the chapter 11 sample code provided in git. Here code is trying to fetch this details from env file. const bingMapsBaseUrl = process.env.BING_MAPS_BASE_URL || ""; ![]() To use / try this code we need BING MAPS BASE URL and BING API KEY. Issue is we cant do new registration with BING now. so can you help us with this issue ? |
Title: Transition from Bing Maps to Google Maps APISummary:Transitioning from Bing Maps API to Google Maps API involves choosing an alternative service due to new registration issues with Bing. Follow detailed steps to install necessary packages, update environment variables, and modify code for seamless integration with Google Maps. Utilize existing keys, explore free/open data alternatives, and seek support if needed. This ensures continued functionality of your application’s geolocation features despite Bing API limitations. Step-by-Step Guide:1. Choose an Alternative Service:
2. Install Necessary Packages:For Google Maps, install the required npm package: npm install @googlemaps/google-maps-services-js 3. Update Environment Variables:Create or update your
4. Modify Your Code:Update your code to integrate Google Maps API. Here is an example: require('dotenv').config();
const { Client } = require("@googlemaps/google-maps-services-js");
const googleMapsBaseUrl = process.env.GOOGLE_MAPS_BASE_URL || "https://maps.googleapis.com/maps/api";
const googleApiKey = process.env.GOOGLE_API_KEY || "";
const client = new Client({});
async function getGeocode(address) {
try {
const response = await client.geocode({
params: {
address: address,
key: googleApiKey
},
baseUrl: googleMapsBaseUrl
});
console.log(response.data.results);
return response.data.results;
} catch (e) {
console.error("Error fetching data from Google Maps API:", e);
}
}
// Example usage:
getGeocode("1600 Amphitheatre Parkway, Mountain View, CA"); 5. Testing:
6. Utilize Existing Keys:If you have any existing Bing Maps API keys, check their validity and use them if still functional. 7. Explore Free/Open Data Alternatives:Consider services like OpenStreetMap for free and open geolocation data which can be integrated using tools like Mapbox. 8. Seek Support If Required:
Following these steps ensures a seamless transition from Bing Maps API to a new service, maintaining the geolocation capabilities of your application without interruption. |
Ah I see now, I was looking at the Python example. Thanks @Abhijitk914 for the detail! Pinging @glaucia86 who is the creator of the TS sample. Is there an alternative the the Bing Maps API or a way people can get access? Seems like the permissions have changed since creating the lesson. |
Describe the bug
There is no python library exists for both chapter 11 and 15.
Additional context
These library require to understand implementation and learning.
The text was updated successfully, but these errors were encountered: